Component Addition Workflow
Add your component to
registry/new-york/ui/your-component.tsx. This is where the actual component code lives.import * as React from "react";
import { cn } from "@/lib/utils";
export interface YourComponentProps {
/** Brief description of this prop */
variant?: "default" | "outline" | "ghost";
/** Always include className for customization */
className?: string;
/** Children when applicable */
children?: React.ReactNode;
}
const YourComponent = React.forwardRef<HTMLDivElement, YourComponentProps>(
({ className, variant = "default", children, ...props }, ref) => {
return (
<div
ref={ref}
className={cn(
"base-classes",
variant === "primary" && "primary-classes",
className
)}
{...props}
>
{children}
</div>
);
}
);
YourComponent.displayName = "YourComponent";
export { YourComponent };
registry/
└── new-york/
└── ui/
├── navbar-menu.tsx
├── raised-button.tsx
├── weather-card.tsx
└── your-component.tsx ← Your new component
{
"name": "your-component",
"type": "registry:ui",
"title": "Your Component",
"description": "A brief, compelling description of what this component does.",
"dependencies": ["react-parallax-tilt"],
"registryDependencies": ["icons"],
"files": [
{
"path": "registry/new-york/ui/your-component.tsx",
"type": "registry:ui"
}
]
}
{
"name": "raised-button",
"type": "registry:ui",
"title": "Raised Button",
"description": "A button with a subtle 3D raised effect and smooth press animation.",
"files": [
{
"path": "registry/new-york/ui/raised-button.tsx",
"type": "registry:ui"
}
]
}
Create preview examples in
components/previews/your-component/. These previews will be shown in the documentation.components/
└── previews/
└── your-component/
├── default.tsx ← Basic usage example
├── with-variants.tsx ← Different variants
└── custom-example.tsx ← Any other demos
import { YourComponent } from "@/registry/new-york/ui/your-component";
export default function YourComponentDefault() {
return (
<YourComponent variant="default">
Example content
</YourComponent>
);
}
If you’re adding a new category or the component needs special placement, update
lib/navigation.ts.Component File Structure
If your component has multiple parts or requires additional files:Testing Your Component Locally
Before submitting, test your component locally:Checklist Before Submitting
Before you consider a component done:- Works in light and dark mode
- Fully keyboard accessible
- Has proper ARIA labels
- Respects reduced motion preferences
- Uses semantic HTML elements
- Follows the spacing guidelines
- No hardcoded colors (uses CSS variables)
- Registered in
registry.json - Has preview components
- Has documentation with props table
- Types are exported
Need Help?
If something isn’t covered here or you’re unsure about a design decision, look at existing components for patterns. Thetool-calls-section, composer, and weather-card components are good references for complex UI.