Generate UI Component
Create custom React components using 21st.dev Magic AI-powered generation.
Usage
code
/generate-ui [component description]
Examples for ESP Dashboard
code
/generate-ui weekly schedule grid with time slots and days /generate-ui semester planning matrix with color-coded cells /generate-ui progress tracking table with percentage bars /generate-ui academic calendar with highlighted events /generate-ui course database table with search and filters /generate-ui dark mode header with department selector /generate-ui tab navigation bar with 5 tabs /generate-ui schedule cell with course info and type badge
Tools Available
| Tool | Purpose |
|---|---|
21st_magic_component_builder | Generate new components from description |
21st_magic_component_inspiration | Get inspiration from 21st.dev library |
21st_magic_component_refiner | Improve existing components |
logo_search | Find brand logos (SVG/TSX) |
Generation Process
- •Parse user description
- •Create search query for 21st.dev
- •Call
21st_magic_component_builderwith:- •message: full description
- •searchQuery: 2-4 word component type
- •absolutePathToProjectDirectory: /Users/ahmede/Documents/dev/web/esp-dashboard
- •standaloneRequestQuery: detailed requirements
- •Receive 3 component variations
- •Write selected component to project
Project Context
- •Path:
/Users/ahmede/Documents/dev/web/esp-dashboard - •Style: shadcn new-york, Tailwind v4, neutral base
- •Components:
src/components/orsrc/pages/ - •TypeScript: Strict mode
- •Theme: ESP Green (#1B5E20, #2E7D32, #4CAF50)
Output Integration
After generation:
- •Save to appropriate directory (src/components/)
- •Add required imports
- •Export from index if needed
- •Verify TypeScript compatibility
- •Apply ESP brand colors if needed
Refinement
To improve an existing component:
code
/generate-ui refine src/components/ScheduleCell.tsx - add hover animation