Theming
The components have no theme layer of their own. They read shadcn/ui’s CSS variables, so your colours and your dark mode apply as soon as they land.
The tokens they read
Change one in your global CSS and the components follow, in light and dark.
| Variable | Its role in shadcn/ui |
|---|---|
| --background--foreground | Default background and text. |
| --primary--primary-foreground | Primary actions. Usually your brand. |
| --muted--muted-foreground | Muted backgrounds and secondary text. |
| --accent | Hover and highlighted backgrounds. |
| --border | Borders. |
| --ring | Focus rings. |
| --popover--popover-foreground | Popovers and menus. |
| --card--card-foreground | Cards. |
| --destructive | Destructive actions. |
| --chart-1--chart-2--chart-3--chart-4--chart-5 | Charts. |
Customise your theme
Colours, dark mode and fonts live in your global CSS, the same file shadcn init wrote. Anything else is a class in the component’s own source, which is yours once it is installed.
- 01
Your brand colour
Set
--primary, the text on it and the focus ring, with a separate value for dark. Any colour format works.app/globals.css11 lines - 02
Your neutrals
Backgrounds, text greys and borders come from the same file.
app/globals.css7 lines - 03
Or paste a whole shadcn theme
Any theme made for shadcn/ui works, from shadcn’s themes or a generator like tweakcn, because these are the variables those themes set.
- 04
A different colour for one section
Variables set on an element apply to everything inside it, so a pricing section or a dashboard panel can carry its own brand.
pricing.tsx3 lines - 05
Corners
Corners are Tailwind classes in each component’s file. In a shadcn project
rounded-smtorounded-xlfollow your--radius; to change any other, likerounded-fullon a pill, edit the class. - 06
Status colours
Error, success and warning colours are classes in the component’s file too. Replace them to use your theme’s.
components/waitlist-field.tsx6 lines - 07
Fonts
Components inherit the font of the page they sit in; code and counters use
font-mono. Set your fonts once, onbodyand in Tailwind’s--font-mono. - 08
One instance
Every component takes
classNamefor its outer element: width, spacing or a one-off colour.settings.tsx1 lines
Dark mode
It is shadcn’s: a .dark class on <html> swaps the variables and the components follow. Use next-themes or your own toggle.
Try a brand
Three real components inside a box that sets only --primary, --primary-foreground and --ring, plus the light or dark set.
Pro
Hear when the next release ships
Plan changes apply today.