Search for a command to run...
Install and configure shadcn/ui with Zaidan for Solid Start.
Start by creating a new Solid Start project:
npm create solid@latest --solidstart --ts --template with-tailwindcsspnpm create solid --solidstart --ts --template with-tailwindcssyarn create solid@latest --solidstart --ts --template with-tailwindcssbun --bun create solid@latest --solidstart --ts --template with-tailwindcssAdd the following code to the vite.config.ts so your app can resolve paths without error:
npm i @types/node -Dpnpm add @types/node -Dyarn add @types/node -Dbun add @types/node -d1import path from "node:path"2import { defineConfig } from "@solidjs/start/config";3import tailwindcss from "@tailwindcss/vite";4
5export default defineConfig({6 vite: {7 plugins: [tailwindcss()],8 resolve: {9 alias: {10 "@": path.resolve(__dirname, "./src"),11 },12 },13 }14});Run the shadcn init command to setup your project:
npx shadcn@latest initpnpx shadcn inityarn dlx shadcn@latest initbunx shadcn@latest initUpdate the components.json file to point to the Zaidan registry and use the kobalte style:
1{2 "$schema": "https://ui.shadcn.com/schema.json",3 "style": "kobalte",4 "rsc": false,5 "tsx": true,6 "tailwind": {7 "config": "",8 "css": "src/styles/globals.css",9 "baseColor": "neutral", // or "gray", "stone", "zinc"10 "cssVariables": true,11 "prefix": ""12 },13 "iconLibrary": "lucide",14 "rtl": false,15 "aliases": {16 "components": "@/components",17 "utils": "@/lib/utils",18 "ui": "@/components/ui",19 "lib": "@/lib",20 "hooks": "@/hooks"21 },22 "menuColor": "default", // or "inverted"23 "menuAccent": "subtle", // or "bold"24 "registries": {25 "@zaidan": "https://zaidan.carere.dev/r/{style}/{name}.json"26 }27}Customize your Design System then
You can now start adding components to your project.
npx shadcn@latest add @zaidan/buttonpnpx shadcn add @zaidan/buttonyarn dlx shadcn@latest add @zaidan/buttonbunx shadcn@latest add @zaidan/buttonThe command above will add the Button component to your project. You can then import it like this:
1import { Button } from "@/components/ui/button";2
3export default function Home() {4 return (5 <div className="flex min-h-svh flex-col items-center justify-center">6 <Button>Click me</Button>7 </div>8 )9}