How shadcn preset codes work (and how to decode one)
October 23, 2026 · 5 min read
A shadcn preset code like b5owWMfJ8l looks random, but it is a precise description of a Shadcn UI setup. Every character carries information about the style, colors, fonts, icons, radius and menus. This guide explains how the codes are built, how to decode one with the shadcn CLI or our tools, and lists every value each field can take.
What a preset code is
A preset code is a compact string generated by shadcn's own encoder. The encoder takes each option in a preset, packs it into a fixed number of bits, and writes the result in base62, the alphabet of digits plus lowercase and uppercase letters. That keeps codes short enough to paste anywhere and safe to use in URLs.
Two practical consequences follow from that design:
- Codes are case-sensitive. In base62,
aandAare different digits, so changing the case changes the preset or makes it invalid. - Codes only describe built-in options. Each field maps to a fixed list of values. A custom hex color or a font outside the list cannot be encoded.
The encoder ships in the shadcn npm package under shadcn/preset, which exports encodePreset, decodePreset and isValidPreset. The CLI and builders use the same logic, so a code produced in one place decodes the same way everywhere.
Decoding a code with the CLI
The quickest way to see what a code contains is the preset decode command:
npx shadcn@latest preset decode b5owWMfJ8l
(pnpm dlx, bunx and yarn dlx work too.)
For b5owWMfJ8l, the decoded values are:
{
"style": "mira",
"baseColor": "mauve",
"theme": "mauve",
"chartColor": "amber",
"iconLibrary": "hugeicons",
"font": "inter",
"fontHeading": "oxanium",
"radius": "large",
"menuAccent": "subtle",
"menuColor": "inverted-translucent"
}
Decoding does not change your project. It is a safe way to check a code before running apply.
Going the other way
To get the code for a project you already have, run:
npx shadcn@latest preset resolve
In a monorepo, pass the app directory with -c, for example -c apps/web.
To open a code in the official shadcn builder, use preset url to print the link (https://ui.shadcn.com/create?preset=<code>) or preset open to open it directly.
Decoding a code into CSS
The CLI tells you which options a code uses, but not the actual CSS variables. Our preset decoder does that: paste any code and it outputs the :root and .dark blocks for its colors and radius, using the same oklch values shadcn writes. It is useful when you want to inspect a theme, diff two presets or paste colors into a project the CLI does not manage.
Want to see it, not just read it?
The preset builder shows any combination on real shadcnblocks blocks and updates the code as you change options.
Every field and its allowed values
These are the ten fields packed into a preset code and the values each can hold.
style
vega, nova, maia, lyra, mira, luma, sera, rhea
Controls component geometry, spacing and density. Vega is the default. See shadcn styles compared. In components.json, the style is stored with the component library, for example radix-luma.
baseColor
neutral, stone, zinc, mauve, olive, mist, taupe
The neutral palette for backgrounds, borders, cards and muted text. The encoder also has a slot for gray, but the registry rejects it, so avoid it. More in shadcn base colors explained.
theme
The preset's own base color, or one of: amber, blue, cyan, emerald, fuchsia, green, indigo, lime, orange, pink, purple, red, rose, sky, teal, violet, yellow
Sets the accent used by primary buttons, focus rings and active states. Neutral-family themes such as stone or zinc only work on the matching base color.
chartColor
Same options as theme: the base color or any accent color. Fills --chart-1 through --chart-5.
iconLibrary
lucide (default), tabler, hugeicons, phosphor, remixicon
See shadcn icon libraries compared.
font
inter, noto-sans, nunito-sans, figtree, roboto, raleway, dm-sans, public-sans, outfit, jetbrains-mono, geist, geist-mono, lora, merriweather, playfair-display, noto-serif, roboto-slab, oxanium, manrope, space-grotesk, montserrat, ibm-plex-sans, source-sans-3, instrument-sans, eb-garamond, instrument-serif
The body font. Our guide to the best fonts for shadcn covers pairings.
fontHeading
Any value from the font list, or inherit to reuse the body font for headings.
radius
| Value | CSS --radius |
|---|---|
none | 0 |
small | 0.45rem |
default | 0.625rem |
medium | 0.625rem |
large | 0.875rem |
menuAccent
subtle, bold
How strongly the highlighted item in menus stands out.
menuColor
default, inverted, default-translucent, inverted-translucent
Whether menu surfaces match the page or invert it, and whether they are translucent.
Reading codes in the wild
Once you know the fields, you can reason about presets quickly. A few examples from our gallery:
| Preset | Code | Style | Base / theme | Font | Radius |
|---|---|---|---|---|---|
| Amber Bakery | b6FU90l32 | vega | taupe / amber | outfit | default |
| Zinc Monolith | b2CQ116p8 | lyra | zinc / zinc | geist | none |
| Amber Broadsheet | b5AzNOyIvi | sera | taupe / amber | source-sans-3 | none |
| Mauve Velvet | b864QDw6Pb | luma | mauve / mauve | montserrat | default |
Notice that codes vary in length. Don't rely on a fixed length when validating them; use isValidPreset or the CLI instead.
Amber Broadsheet
Sera · Amber + Taupe · Noto Serif / Source Sans 3
b5AzNOyIviFAQ
Can I decode a preset code without the CLI?
Yes. Use our preset decoder, open the code in the preset builder, or call decodePreset from shadcn/preset in your own code.
Why are some codes longer than others?
The encoder writes a packed number in base62, so the number of characters depends on the value being encoded. Both lengths are normal.
Can I write my own preset code by hand?
Not practically. Use the builder or encodePreset so the code is valid and decodes to what you expect.
What happens if a code is invalid?
The CLI will refuse to apply it. Check that you copied the whole code with the correct capitalization.
Can a preset code include a custom color?
No. Each field only accepts the values listed above. For custom colors, apply the closest preset and then edit the CSS variables.