Using CSS variables and base colors to theme your components.
Components are styled with shadcn's semantic classes, like bg-primary and text-muted-foreground. Their colors come from CSS variables that ThemeProvider sets for light and dark mode, the same variables npx shadcn init writes to your CSS.
Base colors
The base color sets the neutrals: backgrounds, borders, muted text.
<ThemeProvider baseColor="zinc">…</ThemeProvider>
Theme colors
A theme color is layered over the base color: primary, charts and the sidebar's primary.
<ThemeProvider baseColor="neutral" themeColor="blue">…</ThemeProvider>
Status colors
Beyond shadcn's palette, info, success, warning and error, each with a -foreground, as in daisyUI. They're styled exactly like shadcn's destructive: white text on the color, with the color at 60% in dark mode. error is --destructive, so the two are identical. The shades are Tailwind's, picked so white text has at least 4.5:1 contrast in both modes. Use them as classes (bg-success, text-warning) or through the components' color prop.
<Button color="success">Save</Button>
<Badge variant="soft" color="info">New</Badge>
<Alert variant="dash" color="warning">…</Alert>
<Card variant="dash">…</Card>
Soft and dash
Button, Badge and Alert take daisyUI's soft (a tint of the color) and dash (a dashed outline) variants, in any of the colors: primary, info, success, warning and error. The color also applies to default, outline, ghost and link. Without a color, soft and dash use the foreground. Card takes variant="dash" too: a dashed border without the shadow. Override the status colors with cssVars, like any other variable.
Radius
--radius sets the corner radius the components derive rounded-sm to rounded-4xl from.
<ThemeProvider radius="0.5rem">…</ThemeProvider>
Your own variables
Pass variables in shadcn's registry shape, { theme, light, dark }, without the leading --. Use any CSS color, including oklch():
<ThemeProvider
cssVars={{
theme: { "color-brand": "var(--brand)" },
light: { primary: "oklch(0.55 0.2 265)", brand: "oklch(0.84 0.16 84)" },
dark: { primary: "oklch(0.7 0.15 265)", brand: "oklch(0.41 0.11 46)" },
}}
>
…
</ThemeProvider>
// className="bg-brand"
Try it
The Create page lets you pick a base color, theme, chart colors and radius, and gives you the provider code.