Component Organization
Thecomponents/ directory follows a structured organization pattern:
UI Components (components/ui/)
Base UI primitives wrapped from Radix UI with Tailwind styling and class-variance-authority for variants.
Form Components
Button (button.tsx)
Sizes: default, sm, lg, icon Input (
input.tsx)
textarea.tsx)
checkbox.tsx)
label.tsx)
select.tsx)
Layout Components
Card (card.tsx)
separator.tsx)
sheet.tsx)
tabs.tsx)
Display Components
Avatar (avatar.tsx)
badge.tsx)
skeleton.tsx)
table.tsx)
Interactive Components
Dropdown Menu (dropdown-menu.tsx)
tooltip.tsx)
alert-dialog.tsx)
Generic Components (components/generic/)
Reusable cross-project components designed for portability:
CodeBlock (code-block.tsx) - Syntax-highlighted code display
CategoryGrid (category-grid.tsx) - Grid layout for categories
CtaButton (cta-button.tsx) - Call-to-action button
FloatingNav (floating-nav.tsx) - Floating navigation bar
InfoBox (info-box.tsx) - Information display box
PageHeader (page-header.tsx) - Consistent page headers
ScrollIndicator (scroll-indicator.tsx) - Scroll progress indicator
ThemeToggle (theme-toggle.tsx) - Light/dark mode switcher
ToC (toc.tsx) - Table of contents generator
Project Components (components/project/)
Project-specific chrome components:
Header (header.tsx) - Main navigation header with mobile menu, theme switcher, CTA button
Footer (footer.tsx) - Site footer with links and copyright
Pricing (pricing/) - Pricing table components
Shared Components
FormMessage (form-message.tsx) - Form validation message display
submit-button.tsx) - Form submit button with loading state
theme-switcher.tsx) - Theme selection dropdown
Styling System
Tailwind CSS
All components use Tailwind utility classes:Dark Mode Support
Components automatically support dark mode viadark: prefix:
Class Variance Authority
Component variants managed withclass-variance-authority:
Utility Functions
cn() Helper
Conditional class merging utility:Component Dependencies
Radix UI Packages:- @radix-ui/react-alert-dialog
- @radix-ui/react-avatar
- @radix-ui/react-checkbox
- @radix-ui/react-dropdown-menu
- @radix-ui/react-label
- @radix-ui/react-select
- @radix-ui/react-separator
- @radix-ui/react-slot
- @radix-ui/react-tabs
- @radix-ui/react-tooltip
- tailwindcss
- class-variance-authority
- tailwind-merge
- clsx
- lucide-react
Customization Guidelines
Extending Components
Create custom variants by extending existing components:Creating New Components
Follow the established patterns:Theming
Customize colors intailwind.config.ts:
globals.css:
Best Practices
Component Usage:- Import components from
@/components/ui/*for base primitives - Use semantic HTML elements where appropriate
- Provide accessible labels and ARIA attributes
- Test components in both light and dark modes
- Keep component props minimal and focused
- Use
React.forwardReffor components that need refs - Memoize expensive computations with
useMemo - Avoid inline function definitions in render
- Use
React.memofor pure components
- Include proper ARIA labels
- Ensure keyboard navigation works
- Test with screen readers
- Maintain sufficient color contrast
- Provide focus indicators
Related Pages
Branding & Styling
Customize colors, fonts, and visual identity
Theme Configuration
Configure dark mode and theme settings
Custom Pages
Create new pages using components
App Configuration
Configure app-wide settings

