Create Component
Create a new component using MCP shadcn and distribute it to all theme packages.
Parameters
- •
name(required): Component name in kebab-case (e.g., "data-table", "alert-dialog") - •
themes(optional): Comma-separated themes or "all" (default: "all")
Usage
code
/create-component card /create-component data-table --themes vega,nova
Process
Step 1: Scaffold Base Component
Use the shadcn MCP or CLI to add the component:
bash
bunx shadcn@latest add <component-name>
Step 2: Review Component Structure
Read the generated component and understand its:
- •Props interface
- •Variant configurations (if using CVA)
- •Dependencies (Radix primitives, etc.)
Step 3: Distribute to Theme Packages
For each target theme:
- •Copy component to
packages/ui-{theme}/src/components/{name}.tsx - •Update imports to use
@crazyone/ui-corefor utilities - •Apply theme-specific variant styling if needed
- •Update
packages/ui-{theme}/src/index.tsto export the component
Step 4: Update Registry
Add component entry to registry/index.json:
json
{
"name": "{component-name}",
"type": "registry:ui",
"registryDependencies": []
}
Step 5: Verify Build
bash
bun run build
Example: Creating a Card Component
- •Scaffold:
bunx shadcn@latest add card - •Read generated component
- •For each theme:
- •Copy to theme package
- •Adjust border-radius, shadows per theme style
- •Export from each package's index.ts
- •Add to registry
Notes
- •Always preserve the component's accessibility features
- •Maintain consistent prop interfaces across themes
- •Document any theme-specific behavior differences