System
Customization
Theme presets, CSS variables, local class hooks, and source edits for every primitive.Style Presets
Presets are complete theme objects. They change color, font, density, radius, borders, motion, and effects while keeping the same component source.
Stone
Quiet, minimal product UI with crisp borders and balanced contrast.
import { defineHyzrTheme } from "@hyzrui/core";
export const theme = defineHyzrTheme({
"id": "stone",
"name": "Stone",
"description": "Quiet, minimal product UI with crisp borders and balanced contrast.",
"aesthetic": "minimal",
"density": "comfortable",
"shade": "flat",
"radius": 8,
"shadow": 0.18,
"contrast": 0.84,
"font": "inter",
"colors": {
"background": "#f8fafc",
"foreground": "#111827",
"surface": "#ffffff",
"surfaceRaised": "#ffffff",
"surfaceMuted": "#eef2f7",
"border": "#dce2ea",
"borderStrong": "#bcc6d4",
"primary": "#111827",
"primaryForeground": "#ffffff",
"accent": "#2563eb",
"accentForeground": "#ffffff",
"success": "#147d64",
"warning": "#b45309",
"danger": "#dc2626",
"muted": "#64748b",
"mutedForeground": "#475569",
"ring": "rgba(37, 99, 235, 0.30)"
},
"dark": {
"shade": "raised",
"shadow": 0.4,
"colors": {
"background": "#0a0a0c",
"foreground": "#f5f5f7",
"surface": "#151518",
"surfaceRaised": "#1c1c20",
"surfaceMuted": "#222227",
"border": "#2b2b31",
"borderStrong": "#3d3d45",
"primary": "#f5f5f7",
"primaryForeground": "#111114",
"accent": "#3b82f6",
"accentForeground": "#ffffff",
"success": "#34d399",
"warning": "#fbbf24",
"danger": "#f87171",
"muted": "#9b9ba6",
"mutedForeground": "#c5c5cf",
"ring": "rgba(59, 130, 246, 0.40)"
}
},
"mode": "light",
"typography": {
"baseSize": 14,
"controlSize": 14,
"labelSize": 13,
"leadSize": 16,
"headingWeight": 680,
"titleWeight": 620,
"bodyWeight": 400,
"controlWeight": 500,
"labelWeight": 560,
"lineHeight": 1.58,
"letterSpacing": "0px"
},
"sizing": {
"controlHeight": 38,
"controlPadding": 13,
"fieldPadding": 12,
"cardPadding": 18,
"buttonHeight": 34,
"buttonPadding": 14,
"buttonGap": 8,
"iconButtonSize": 34,
"badgeHeight": 22,
"gap": 12,
"gridGap": 20,
"sectionGap": 34,
"containerWidth": 1180,
"sidebarWidth": 256,
"tocWidth": 240,
"dialogWidth": 520,
"sheetWidth": 420,
"drawerWidth": 430,
"floatingOffset": 8
},
"borders": {
"radius": 8,
"radiusSm": 5,
"radiusLg": 14,
"radiusFull": 999,
"width": 1,
"strongWidth": 1,
"focusWidth": 2
},
"motion": {
"duration": 150,
"easing": "cubic-bezier(.2, .8, .2, 1)",
"hoverLift": 0,
"activePress": 1,
"hoverMix": 5,
"disabledOpacity": 0.55
},
"effects": {
"overlayOpacity": 0.38,
"backdropBlur": 0,
"shadow": 0,
"shadowSoft": 0,
"floatingShadow": 0.12
},
"palette": {
"chart1": "#111827",
"chart2": "#64748b",
"chart3": "#bcc6d4",
"chart4": "#eef2f7",
"chart5": "#2563eb"
}
});Theme Provider
Wrap any part of your app in HyzrThemeProvider. The provider writes CSS variables, so nested components inherit the same visual language automatically.
import { HyzrThemeProvider } from "@hyzrui/core";
import { productTheme } from "./theme";
export function App() {
return (
<HyzrThemeProvider theme={productTheme}>
<Dashboard />
</HyzrThemeProvider>
);
}import { defineHyzrTheme } from "@hyzrui/core";
export const productTheme = defineHyzrTheme({
id: "product",
name: "Product",
aesthetic: "minimal",
density: "comfortable",
shade: "flat",
font: "inter",
radius: 8,
shadow: 0.12,
contrast: 0.92,
colors: {
background: "#fbfbfc",
foreground: "#09090b",
surface: "#ffffff",
surfaceRaised: "#ffffff",
surfaceMuted: "#f4f4f5",
border: "#e4e4e7",
borderStrong: "#d4d4d8",
primary: "#18181b",
primaryForeground: "#ffffff",
accent: "#52525b",
accentForeground: "#ffffff",
},
typography: {
baseSize: 14,
controlSize: 14,
controlWeight: 500,
headingWeight: 680,
lineHeight: 1.58,
},
sizing: {
controlHeight: 38,
buttonHeight: 34,
buttonPadding: 14,
cardPadding: 18,
gridGap: 20,
dialogWidth: 520,
},
borders: {
radius: 8,
radiusSm: 5,
radiusLg: 14,
width: 1,
focusWidth: 2,
},
motion: {
duration: 150,
easing: "cubic-bezier(.2, .8, .2, 1)",
hoverLift: 0,
hoverMix: 5,
},
});Color palettes
| Token | What it controls |
|---|---|
colors.background | Page background and the root provider surface. |
colors.foreground | Default text and icon color. |
colors.surface | Cards, panels, inputs, and menus. |
colors.surfaceMuted | Secondary controls, command rows, and quiet fills. |
colors.border | Default edge color for controls and surfaces. |
colors.primary | Main action controls and selected states. |
colors.accent | Optional brand accent, charts, and highlights. |
palette.chart1...chart5 | Data colors used by chart-like examples and progress visuals. |
Typography and weight
| Token | What it controls |
|---|---|
font | Inter, system, serif, mono, or rounded font stack. |
typography.baseSize | Root component text size. |
typography.controlSize | Buttons, inputs, menus, tabs, and command rows. |
typography.labelSize | Labels, badges, metadata, and helper labels. |
typography.headingWeight | Page and section heading emphasis. |
typography.controlWeight | Button, tab, menu, and compact action weight. |
typography.lineHeight | Reading rhythm for body copy and descriptions. |
Sizing, layout, and positioning
| Token | What it controls |
|---|---|
density | Compact, comfortable, or spacious defaults. |
sizing.controlHeight | Input, select, search, and trigger height. |
sizing.buttonHeight | Default button height independent from fields. |
sizing.buttonPadding | Horizontal button rhythm for all variants. |
sizing.cardPadding | Internal card, dialog, sheet, and panel padding. |
sizing.gridGap | Preview grids and layout collage spacing. |
sizing.containerWidth | Main content width for docs and app shells. |
sizing.dialogWidth | Centered modal width. |
sizing.sheetWidth | Side sheet width. |
sizing.floatingOffset | Popover, menu, tooltip, and hover-card distance from trigger. |
Borders and radius
| Token | What it controls |
|---|---|
radius | The quick root radius used by the default border scale. |
borders.radius | Default component radius. |
borders.radiusSm | Compact controls, attached groups, and small pills. |
borders.radiusLg | Cards, dialogs, sheets, drawers, and large surfaces. |
borders.width | Default border width for controls and cards. |
borders.focusWidth | Keyboard focus outline width. |
Hover, motion, and effects
| Token | What it controls |
|---|---|
motion.duration | Shared transition duration. |
motion.easing | Shared easing curve. |
motion.hoverLift | Subtle hover translation for raised styles. |
motion.activePress | Pressed-state translation. |
motion.hoverMix | How much foreground color mixes into hover surfaces. |
motion.disabledOpacity | Global disabled opacity. |
effects.overlayOpacity | Dialog, drawer, sheet, and command overlay strength. |
effects.backdropBlur | Optional glass backdrop blur. |
effects.floatingShadow | Menus, search, popovers, and floating panels. |
Local CSS
Use global tokens for shared behavior, then override variables or component classes inside a local wrapper when a single layout needs a different rhythm.
Billing summary
Local padding, radius, and button rhythm.
.billing-panel {
--hui-card-padding: 22px;
--hui-radius-lg: 18px;
--hui-button-height: 36px;
--hui-hover-lift: -1px;
}
.billing-panel .hui-button {
font-weight: 540;
}Source Edits
HyzrUI is not a sealed package. Install the primitive, keep the default structure, then edit the copied source whenever props and tokens are not enough.
pnpm dlx hyzrui add button
pnpm dlx hyzrui add dialog
pnpm dlx hyzrui add search-bar// src/components/ui/button.tsx
// Keep the public API small, then adjust internal classes for your product.
export function Button({ variant = "solid", size = "md", ...props }) {
return <button data-variant={variant} data-size={size} {...props} />;
}API Reference
The provider accepts a theme object, normal div props, and local styles. Component docs show the local props for each primitive.
| Prop | Type | Description |
|---|---|---|
theme | HyzrTheme | Theme object from defineHyzrTheme or getHyzrThemePreset. |
className | string | Wrapper class used for scoped overrides and layout-specific tuning. |
style | CSSProperties | Inline CSS variables for one-off examples or generated previews. |
children | React.ReactNode | Components that inherit the theme variables. |