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>| Theme | Accent | Font pairing (display / body) | Appearance |
|---|---|---|---|
| Default | Monochrome | Space Grotesk / Inter | light |
| Linear | Violet | Inter / Inter | dark |
| Nordic | Teal | Outfit / Inter | light |
| Vanguard | Red | Space Grotesk / Inter | dark |
| Cyber | Lime | JetBrains Mono / Inter | dark |
| Editorial | Bronze | Fraunces / Inter | light |
| Neo Tokyo | Ruby | Space Grotesk / Inter | dark |
| Oasis | Jade | Outfit / Inter | light |
| Ocean | Mint | Space Grotesk / Inter | light |
| Velvet | Plum | Playfair Display / Inter | dark |
| Minimal | Monochrome | Outfit / Inter | light |
| Warm | Amber | Lora / Inter | light |
| Playful | Iris | Space Grotesk / Space Grotesk | light |
| Sunset | Crimson | Outfit / Inter | dark |
| Midnight | Cyan | Space Grotesk / Inter | dark |
| Terminal | Green | JetBrains Mono / JetBrains Mono | dark |
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.