CLAUDE.mdtypescript
react-starter CLAUDE.md
This project uses a comprehensive UI component library located in `src/components/ui/`.
Project Guidelines
UI Component Library
This project uses a comprehensive UI component library located in src/components/ui/.
Important: Always use existing UI components from src/components/ui/ instead of creating custom implementations or using plain HTML elements.
Available Components
The following components are available in src/components/ui/:
Form Controls & Inputs
input.tsx- Text input with various types (text, email, password, search, etc.)textarea.tsx- Multi-line text inputselect.tsx- Dropdown select with trigger, content, and itemscheckbox.tsx- Single checkboxcheckbox-group.tsx- Group of checkboxesradio-group.tsx- Radio button groupswitch.tsx- Toggle switchslider.tsx- Range slidernumber-field.tsx- Numeric input with increment/decrement
Buttons & Interactive
button.tsx- Standard button componenttoggle.tsx- Toggle button (on/off state)toggle-group.tsx- Group of toggle buttons
Navigation & Structure
menu.tsx- Dropdown menu with itemstabs.tsx- Tabbed interfacebreadcrumb.tsx- Breadcrumb navigationpagination.tsx- Page navigation controlstoolbar.tsx- Action toolbar container
Layout & Containers
card.tsx- Card container with header, content, footerseparator.tsx- Horizontal or vertical dividersheet.tsx- Slide-out panel/drawersidebar.tsx- Sidebar layout componentscroll-area.tsx- Custom scrollable areaframe.tsx- Frame containergroup.tsx- Grouping container
Dialogs & Overlays
dialog.tsx- Modal dialogalert-dialog.tsx- Alert/confirmation dialogpopover.tsx- Popover tooltip contenttooltip.tsx- Hover tooltip
Feedback & Status
alert.tsx- Alert/notification bannertoast.tsx- Toast notificationprogress.tsx- Progress barmeter.tsx- Meter/gauge componentspinner.tsx- Loading spinnerskeleton.tsx- Loading skeleton placeholderempty.tsx- Empty state component
Data Display
table.tsx- Data table componentbadge.tsx- Label/badge for status or countavatar.tsx- User avatar/profile picturekbd.tsx- Keyboard shortcut displaypreview-card.tsx- Preview card component
Advanced Components
combobox.tsx- Searchable select dropdownautocomplete.tsx- Autocomplete inputcommand.tsx- Command palette/menucollapsible.tsx- Collapsible sectionaccordion.tsx- Accordion with multiple collapsible items
Form Structure
form.tsx- Form wrapper componentfield.tsx- Form field wrapperfieldset.tsx- Form fieldset groupinglabel.tsx- Form labelinput-group.tsx- Input group container
Usage Guidelines
- Always check for existing components before creating custom UI elements
- Import from
./ui/or@/components/ui/depending on the file location - Follow the component patterns - check existing usage in the codebase for examples
- Use Tailwind CSS for styling - the components are built with Tailwind
- Don't reinvent the wheel - if a component exists, use it
Examples
Good:
import { Input } from './ui/input'
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './ui/select'
import { Button } from './ui/button'
<Input type="text" placeholder="Search..." size="sm" />
<Select value={value} onValueChange={setValue}>
<SelectTrigger>
<SelectValue placeholder="Choose option" />
</SelectTrigger>
<SelectContent>
<SelectItem value="1">Option 1</SelectItem>
</SelectContent>
</Select>
Bad:
// Don't use plain HTML elements when components exist
<input type="text" className="..." />
<select className="...">
<option>Option 1</option>
</select>
Technology Stack
- Framework: React 19 with TypeScript
- Build Tool: Vite (using rolldown-vite)
- Styling: Tailwind CSS v4
- UI Base: @base-ui/react
- Icons: lucide-react
- Routing: react-router-dom
Code Style
- Use functional components with hooks
- Prefer
typeimports for TypeScript types:import type { ... } - Use Tailwind utility classes for styling
- Keep components focused and composable