Installation Pattern
All UI components follow the shadcn/ui pattern:src/components/ui/ and can be customized directly.
Button Component
The Button component usesclass-variance-authority for variant management with custom hero styles.
API
src/components/ui/button.tsx
Custom Variants
The portfolio adds two custom hero variants:- hero
- heroOutline
Sizes
asChild Prop
TheasChild prop uses Radix UI’s Slot component to render the button as a different element:
Accordion Component
Collapsible accordion built with Radix UI primitives.API
src/components/ui/accordion.tsx
Usage
- Auto-rotating chevron icon on open/close
- Smooth accordion-up/down animations
- Single or multiple item expansion
- Keyboard navigation support
Tooltip Component
Tooltip component for displaying contextual information.API
src/components/ui/tooltip.tsx
Usage
TooltipProvider must wrap the entire app (see src/App.tsx).
Toast Components
Dual toast notification system using both Radix UI Toast and Sonner.Radix UI Toast
Sonner Toast
Simplified toast library with better DX:src/components/ui/sonner.tsx
Custom Hook: use-toast
src/components/ui/use-toast.ts
Styling Utilities
All components use thecn() utility for class name merging:
src/lib/utils.ts
Icon System
All icons use Lucide React:w-4 h-4- Small icons (16px) for buttonsw-5 h-5- Medium icons (20px) for linksw-6 h-6- Large icons (24px) for mobile menu
Next Steps
Component Architecture
Learn about the overall component structure
Animations
Explore ScrollReveal and animation patterns
