Skip to content

shadcn theme generator

Pick a primary colour, a grey, a radius and fonts. The preview shows your theme on six finished blocks, light and dark, and every text colour is checked for contrast. Copy the CSS or install it with the shadcn CLI. Or start from one of 37 presets taken from our website themes.

Hex, rgb(), hsl() or oklch(). Pale colours move darker for light mode so text on them reads.

Grey

The install command carries the whole theme in its URL: nothing is saved on our side. This page’s address does the same, so bookmark it to come back.

In the preview: Hero, Pricing, Comparison table, Contact form, FAQ, Site footer. All free, MIT, one command each.

Contrast checks

All 30 pairs pass, light and dark

Text needs WCAG AA (4.5:1) and APCA Lc 60; focus rings 3:1 on the page.

Every pair
PairLightDark
Body text19.80 · Lc 10618.59 · Lc 104
Secondary text on the page5.29 · Lc 769.86 · Lc 64
Text in cards19.80 · Lc 10617.16 · Lc 104
Secondary text in cards5.29 · Lc 769.10 · Lc 63
Menus and popovers19.80 · Lc 10617.16 · Lc 104
Primary buttons8.57 · Lc 938.96 · Lc 62
Links and outline accents8.57 · Lc 899.25 · Lc 61
Secondary buttons16.28 · Lc 9814.49 · Lc 101
Text on muted panels4.80 · Lc 707.68 · Lc 61
Hovered menu items10.10 · Lc 8813.14 · Lc 100
Error messages4.77 · Lc 709.27 · Lc 61
Sidebar18.95 · Lc 10317.16 · Lc 104
Sidebar active item8.57 · Lc 938.96 · Lc 62
Sidebar hover16.28 · Lc 9814.49 · Lc 101
Focus ring8.578.68

Or start from a finished site

Each preset is the colour and type set of one of our 29 website themes, already proven on a whole site.

All 37 presets

Questions

How do I make a shadcn/ui theme from my brand colour?
Paste your brand colour (hex, rgb, hsl or oklch) as the primary. The generator writes the whole set from it: --primary and --ring in a shade that reads on white, a deeper one for light mode if your colour is pale, a brighter one for dark mode, a tinted --accent, five --chart colours, and greys from the neutral you pick. Every text pair is then checked and fixed to WCAG AA. Copy the CSS into globals.css or install it with npx shadcn add.
How do I use the theme I made?
Copy the install command and run it in a project set up with npx shadcn init: the CLI writes the light and dark variables, the radius and the fonts into your stylesheet. Or copy the CSS and paste it over the :root and .dark values in globals.css. Or copy the prompt and give it to Claude Code, Cursor or v0.
Is my theme saved?
Not on our side. The whole theme lives in the page address and in the install URL, so the link is the save: bookmark it, or send it to someone, and it opens the same theme.
What do the contrast checks test?
Every pair shadcn/ui draws text with, in light and dark: body text, muted text on the page and on cards, the label on a primary button, links, menus, errors and the sidebar. Each must reach WCAG AA (4.5:1) and APCA Lc 60; the focus ring must reach 3:1. With the fix switched on, the generator moves a failing text colour just far enough to pass.
Why does my primary colour look darker in light mode?
shadcn/ui uses --primary for links and outlines on the page as well as for buttons. A pale colour such as yellow or mint would be unreadable as text on white, so the light set uses a deeper shade of it. The dark set keeps it bright.
Which fonts can I pick?
Sans-serif families we use in our own themes, all free on Google Fonts and Fontsource. The preview loads them from Bunny Fonts. Your project needs to load the font itself; the install shows the Fontsource package.
How is this different from tweakcn or shadcn create?
Those are full editors. This one is deliberately small: four choices, a preview on finished blocks instead of a component sheet, and contrast fixed for you. If you would rather start from something proven, pick one of the presets from our website themes.