hyzrui
HomeDocsCustomization

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.

minimal

Stone

Quiet, minimal product UI with crisp borders and balanced contrast.

Current preset
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.

Provider usage
import { HyzrThemeProvider } from "@hyzrui/core";
import { productTheme } from "./theme";
 
export function App() {
  return (
    <HyzrThemeProvider theme={productTheme}>
      <Dashboard />
    </HyzrThemeProvider>
  );
}
Full theme shape
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

TokenWhat it controls
colors.backgroundPage background and the root provider surface.
colors.foregroundDefault text and icon color.
colors.surfaceCards, panels, inputs, and menus.
colors.surfaceMutedSecondary controls, command rows, and quiet fills.
colors.borderDefault edge color for controls and surfaces.
colors.primaryMain action controls and selected states.
colors.accentOptional brand accent, charts, and highlights.
palette.chart1...chart5Data colors used by chart-like examples and progress visuals.

Typography and weight

TokenWhat it controls
fontInter, system, serif, mono, or rounded font stack.
typography.baseSizeRoot component text size.
typography.controlSizeButtons, inputs, menus, tabs, and command rows.
typography.labelSizeLabels, badges, metadata, and helper labels.
typography.headingWeightPage and section heading emphasis.
typography.controlWeightButton, tab, menu, and compact action weight.
typography.lineHeightReading rhythm for body copy and descriptions.

Sizing, layout, and positioning

TokenWhat it controls
densityCompact, comfortable, or spacious defaults.
sizing.controlHeightInput, select, search, and trigger height.
sizing.buttonHeightDefault button height independent from fields.
sizing.buttonPaddingHorizontal button rhythm for all variants.
sizing.cardPaddingInternal card, dialog, sheet, and panel padding.
sizing.gridGapPreview grids and layout collage spacing.
sizing.containerWidthMain content width for docs and app shells.
sizing.dialogWidthCentered modal width.
sizing.sheetWidthSide sheet width.
sizing.floatingOffsetPopover, menu, tooltip, and hover-card distance from trigger.

Borders and radius

TokenWhat it controls
radiusThe quick root radius used by the default border scale.
borders.radiusDefault component radius.
borders.radiusSmCompact controls, attached groups, and small pills.
borders.radiusLgCards, dialogs, sheets, drawers, and large surfaces.
borders.widthDefault border width for controls and cards.
borders.focusWidthKeyboard focus outline width.

Hover, motion, and effects

TokenWhat it controls
motion.durationShared transition duration.
motion.easingShared easing curve.
motion.hoverLiftSubtle hover translation for raised styles.
motion.activePressPressed-state translation.
motion.hoverMixHow much foreground color mixes into hover surfaces.
motion.disabledOpacityGlobal disabled opacity.
effects.overlayOpacityDialog, drawer, sheet, and command overlay strength.
effects.backdropBlurOptional glass backdrop blur.
effects.floatingShadowMenus, 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.

Production$1,200.00
Scoped override
.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.

Install source
pnpm dlx hyzrui add button
pnpm dlx hyzrui add dialog
pnpm dlx hyzrui add search-bar
Edit the primitive
// 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.

PropTypeDescription
themeHyzrThemeTheme object from defineHyzrTheme or getHyzrThemePreset.
classNamestringWrapper class used for scoped overrides and layout-specific tuning.
styleCSSPropertiesInline CSS variables for one-off examples or generated previews.
childrenReact.ReactNodeComponents that inherit the theme variables.