Back to InstallationYou are on SolidStart.
Installation

SolidStart

The Solid registry items keep their signals, their springs and their reduced-motion branch.

SolidMeta-frameworksSolid, file routes and server rendering.

Prerequisites

You need SolidStart 2, Tailwind CSS v4 and the ~/* alias used by the Solid starter.

  • Node.js 24 or newer, as required by SolidStart 2.
  • A SolidStart app created with create-solid.
  • Tailwind CSS v4 through @tailwindcss/vite.
  • The ~/* alias in tsconfig.json, which the starter already declares.

New app or existing app

Create a SolidStart app with the official starter and the basic TypeScript template, then install its dependencies. The command below is the non-interactive spelling of the wizard.

Create a SolidStart app

npx create-solid@latest my-app --solidstart --template basic --ts --v2
npmthe default on every machine

Install the dependencies

npm install
npmthe default on every machine

Already have an app? Keep its file routes and add Tailwind CSS v4 before running the registry commands.

Configuration

Add Tailwind to the Vite pipeline and create components.json. Solid projects do not run shadcn init, because the initializer assumes React; the file below gives the CLI the aliases it needs.

Install the runtime

npm install tailwindcss @tailwindcss/vite
npmthe default on every machine
vite.config.ts
import { defineConfig } from "vite";
import tailwindcss from "@tailwindcss/vite";
import { nitro } from "nitro/vite";
import { solidStart } from "@solidjs/start/config";

export default defineConfig({
  plugins: [solidStart(), tailwindcss(), nitro()],
});
components.json
{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "default",
  "rsc": false,
  "tsx": true,
  "tailwind": {
    "config": "",
    "css": "src/app.css",
    "baseColor": "neutral",
    "cssVariables": true,
    "prefix": ""
  },
  "aliases": {
    "components": "~/components",
    "utils": "~/lib/utils",
    "ui": "~/components/ui",
    "lib": "~/lib",
    "hooks": "~/hooks"
  },
  "iconLibrary": "lucide"
}
src/app.css
@import "tailwindcss";

@custom-variant dark (&:is(.dark *));

:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.985 0 0);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --destructive-foreground: oklch(0.985 0 0);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

Add a component

The shadcn CLI fetches the Solid item, writes the file and installs motion and lucide-solid. Import it from the src/components/prequelui folder.

Add the animated component

npx shadcn@latest add https://prequeluianimate.terravidhal.me/r/solid/dialog.json
npmthe default on every machine
src/routes/index.tsx
import { Dialog } from "~/components/prequelui/dialog";

export default function Home() {
  return (
    <div class="grid min-h-svh place-items-center">
      <Dialog trigger="Open dialog" title="A SolidStart route" />
    </div>
  );
}

Dark mode

Toggle the dark class on the document after mount, so the server render and the first client frame agree.

src/components/theme.tsx
import { onMount } from "solid-js";

export function Theme() {
  onMount(() => {
    const saved = localStorage.getItem("theme");
    const dark =
      saved === "dark" ||
      (!saved && matchMedia("(prefers-color-scheme: dark)").matches);
    document.documentElement.classList.toggle("dark", dark);
  });
  return null;
}

Verification

Run the dev server, open the route and check the dialog. Then test the theme and reduced motion.

  • The dialog opens on the client and does not flash on the server render.
  • The theme tokens apply in both modes.
  • Reduced motion keeps the final state without scale or blur.

Start the dev server

npm run dev
npmthe default on every machine

More Solid guides

All frameworks

Built by Vidhal. The source is available on GitHub.

MIT licensed