Theme System

Dynamic Swatch Configurations

Shavin UI ships with 24 distinct accent color palettes, 5 grayscales, and sizing scale factors. To load a specific theme preset configuration, wrap your root elements inside the ThemeProvider context wrapper:

import { ThemeProvider } from "@shavin/ui";

export default function App() {
  return (
    <ThemeProvider
      accentColor="grass"
      grayColor="zinc"
      radius="medium"
      scaling="95%"
      panelBackground="translucent"
    >
      <MainLayout />
    </ThemeProvider>
  );
}

Theme presets

Skip the individual props — pass a single theme to load a curated brand config: accent, neutrals, radius, density, panel style, and a display/body font pairing. Add individual props alongside to override any of it.

import { ThemeProvider } from "@shavin/ui";

<ThemeProvider theme="Editorial">
  <App />
</ThemeProvider>
ThemeAccentFont pairing (display / body)Appearance
DefaultMonochromeSpace Grotesk / Interlight
LinearVioletInter / Interdark
NordicTealOutfit / Interlight
VanguardRedSpace Grotesk / Interdark
CyberLimeJetBrains Mono / Interdark
EditorialBronzeFraunces / Interlight
Neo TokyoRubySpace Grotesk / Interdark
OasisJadeOutfit / Interlight
OceanMintSpace Grotesk / Interlight
VelvetPlumPlayfair Display / Interdark
MinimalMonochromeOutfit / Interlight
WarmAmberLora / Interlight
PlayfulIrisSpace Grotesk / Space Grotesklight
SunsetCrimsonOutfit / Interdark
MidnightCyanSpace Grotesk / Interdark
TerminalGreenJetBrains Mono / JetBrains Monodark

Font pairings load from Google Fonts on demand. Tweak any control in the Configurator (top-right) and the preset auto-switches to “Custom”.

Presets List Options

The following runtime presets are fully supported and mapped inside our theme manifest:

Accent Swatches

Choose between named presets like grass, tomato, amber, iris, indigo, and gold. Alternatively, supply an arbitrary brand color hex (like #ff0088).

Gray Swatches

Select an interface grayscale family to match your accent palette: gray, mauve, slate, sage, or zinc.

Radii Presets

Configure component border radii: none (0px), small (4px), medium (8px), large (12px), or full (stadium-shaped).

Scale Multipliers

Adjust spacing densities to fit layouts: 90%, 95%, 100%, 105%, or 110%.

Appearance states

Light and dark states are driven by toggling the standard .dark class on parent wrapper wrappers. The design system reads variables dynamically, allowing layout colors to adjust seamlessly.

Gotcha: In dark mode, accent swatches automatically adjust contrast levels, ensuring buttons remain completely legible.
Configure Theme
Theme
Accent Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font