Button
A versatile button component with multiple variants and sizes. Location:src/components/ui/Button.tsx:12
Props
Button style variantOptions:
primary: Blue background, white textsecondary: Surface background with borderdanger: Red background, white textghost: Transparent with hover effect
Button sizeOptions:
sm: 2rem height, 0.75rem padding, 0.75rem fontmd: 2.5rem height, 1rem padding, 0.875rem fontlg: 3rem height, 2rem padding, 1rem font
Shows a loading spinner and disables the button
Icon element to display before button text (typically from Lucide)
Disables the button and reduces opacity
Button content (text or elements)
Usage Examples
Primary Button:Styling Details
The Button component uses inline styles with CSS variables for theming:onMouseEnter and onMouseLeave handlers to apply hover effects dynamically:
Card
A container component with optional title and action area. Location:src/components/ui/Card.tsx:10
Props
Card content
Additional CSS class names
Card header title
Action element displayed in header (typically a Button)
Usage Examples
Simple Card:Structure
The Card component has two main sections:-
Header (optional): Displayed when
titleoractionis provided- Contains title and action element
- Has bottom border for separation
- Uses flexbox for space-between layout
- Content: Always rendered with consistent padding
Input
A text input component with label and error display. Location:src/components/ui/Input.tsx:8
Props
Input label displayed above the field
Error message displayed below the field in red
HTML input type (text, email, tel, etc.)
Controlled input value
Change handler function
Placeholder text
Disables the input
Usage Example
Focus State
The Input component changes border color on focus:Styling
- Height:
2.5rem - Border:
1px solid var(--color-border) - Border radius:
var(--radius-md) - Padding:
0 0.75rem - Font size:
0.875rem
TextArea
A multi-line text input component with label and error display. Location:src/components/ui/Input.tsx:48
Props
TextArea label displayed above the field
Error message displayed below the field
Controlled textarea value
Change handler function
Placeholder text
Number of visible text lines
Usage Example
Features
- Resizable: Vertical resize enabled via CSS
- Min height:
5remby default - Font inheritance: Uses
fontFamily: 'inherit'for consistency - Same focus behavior as Input component
CSS Variables
All UI components use CSS variables for theming. Here are the key variables:Colors
Spacing
Border Radius
Design Patterns
Controlled Components
All form components are controlled:Forward Refs
Button, Input, and TextArea useReact.forwardRef to allow ref access:
Icon Integration
Components integrate with Lucide React icons:Inline Styles
Components use inline styles with CSS variables rather than CSS modules or styled-components. This approach:- Provides full control over dynamic styling
- Maintains theme consistency via CSS variables
- Avoids CSS-in-JS runtime overhead
- Keeps component logic and styles co-located
Hover State Management
Components manage hover states via event handlers rather than CSS pseudoclasses for more control:Accessibility
ARIA Labels
Buttons with only icons should includearia-label:
Form Labels
All Input and TextArea components support labels for screen readers:Keyboard Navigation
All interactive components support standard keyboard navigation (Tab, Enter, Space) through native HTML elements.Future Enhancements
Potential improvements to the UI component library:- Select/Dropdown component: For template selection and other options
- Checkbox/Radio components: Styled form controls
- Modal/Dialog component: For confirmations and complex forms
- Toast/Notification system: User feedback for actions
- Tooltip component: Contextual help and information
- Form validation: Integration with validation libraries

