A custom shadcn registry that transforms all 1,362 unDraw illustrations into customizable React components with TypeScript support.
- π¨ Customizable Colors: Primary colors automatically use your CSS
--color-primaryvariable - π¦ Easy Installation: Install illustrations using the shadcn CLI
- β‘ Optimized SVGs: All illustrations converted to clean React components
- π§ Fully Typed: Complete TypeScript support with proper interfaces
- π― shadcn Compatible: Works seamlessly with any shadcn/ui project
- π± Responsive: All components are responsive and accessible with built-in titles
Add the unDraw registry to your components.json file:
{
"registries": {
"@undraw": "https://undraw-cn.vaatun.com/r/{name}.json"
}
}Use the shadcn CLI to add any illustration:
npx shadcn@latest add @undraw/a-whole-year
npx shadcn@latest add @undraw/creative-team
npx shadcn@latest add @undraw/mobile-loginImport and use the illustration in your React app:
import { AWholeYear } from "@/registry/new-york/illustrations/a-whole-year/a-whole-year";
export function MyComponent() {
return (
<div className="flex items-center justify-center p-8">
<AWholeYear className="w-full max-w-md" />
</div>
);
}All illustration components accept standard SVG props:
export interface IllustrationProps extends SVGProps<SVGSVGElement> {}
// Usage
<AWholeYear
className="w-64 h-64"
style={{ opacity: 0.8 }}
role="img"
aria-label="A whole year illustration"
/>;The primary color in all illustrations automatically uses your CSS variable --color-primary. You can customize it globally in your CSS:
:root {
--color-primary: #5b3d91; /* Your brand color */
}Or use the color picker on the live demo to preview different colors.
Browse and search all 1,362 illustrations at undraw-cn.vaatun.com
This registry uses the shadcn CLI infrastructure:
- Source SVGs: Original unDraw SVG files sourced from balazser/undraw-svg-collection
- Conversion: The
tools/convert-svgs.jsscript converts SVGs to React components:- Parses SVG attributes and converts to JSX format
- Converts kebab-case attributes to camelCase (e.g.,
stroke-widthβstrokeWidth) - Handles inline styles and merges CSS attributes
- Generates TypeScript interfaces for each component
- Registry Generation: Components are registered in
registry.json - Build Process:
shadcn buildgenerates individual JSON files inpublic/r/ - Distribution: Static files are served via Azure Static Web Apps
- Node.js 18+
- pnpm (recommended) or npm
# Clone the repository
git clone https://github.com/vaatun/undraw-cn.git
cd undraw-cn
# Install dependencies
pnpm install
# Run development server
pnpm devTo convert unDraw SVGs to React components:
node tools/convert-svgs.jsThis will:
- Read SVG files from the configured source directory
- Generate React components in
registry/new-york/illustrations/ - Update both
registry.jsonandpublic/r/registry.json
pnpm registry:buildThis generates the registry files and serves them under public/r/.
Test registry items locally:
# Start development server
pnpm dev
# In another terminal, install from local registry
npx shadcn@latest add http://localhost:3000/r/a-whole-year.jsonundraw-cn/
βββ app/ # Next.js app directory
βββ components/
β βββ ui/ # shadcn UI components
β βββ illustration-card.tsx # Card component for illustrations
β βββ site-header.tsx # Site header with setup guide
β βββ site-footer.tsx # Site footer
β βββ ...
βββ registry/
β βββ new-york/
β βββ illustrations/ # All illustration components
β βββ a-whole-year/
β β βββ a-whole-year.tsx
β βββ ...
βββ public/
β βββ r/ # Built registry JSON files
βββ tools/
β βββ convert-svgs.js # SVG to React converter
βββ registry.json # Main registry definition
βββ components.json # shadcn configuration
The project is deployed on Azure Static Web Apps with automatic deployments from the main branch.
# Build the project
pnpm build
# Deploy to Azure (configured via GitHub Actions)
git push origin mainunDraw is an open-source illustration project created by Katerina Limpitsouni featuring beautiful, customizable SVG illustrations.
- β¨ Open-source and free to use
- π¨ Customizable colors
- π SVG format for infinite scalability
- πΌ Commercial use allowed
- π« Don't redistribute unDraw as your own
See unDraw License for full terms.
Contributions are welcome! Please feel free to submit a Pull Request.
- Registry Code: MIT License
- unDraw Illustrations: Open source by Katerina Limpitsouni - free for commercial and personal use
- See unDraw License for illustration usage terms
- Illustrations: Created by Katerina Limpitsouni
- SVG Source Collection: balazser/undraw-svg-collection
- Registry Infrastructure: Built on shadcn/ui
- Original unDraw: undraw.co
Built with β€οΈ using Next.js, shadcn/ui, and unDraw