Documentation / Global presets
Global presets
Understand project defaults, tokens, and component scope.
Choose the right scope
- Global preset
- A style family, light/dark semantic colors, bounded design values, and supported component defaults saved for the project. Ordinary component additions inherit it.
- Component recipe
- One component’s content, props, preset reference, and supported overrides. It installs separately without changing saved project defaults.
- Preset-scoped Button
- A separate Button compiled from a whole preset. Use this when a Button needs its own preset rather than the project’s shared theme.
A component recipe and a global preset have different JSON formats. Use --recipe for recipe exports and --preset for preset exports.
Apply a global preset
- Build the theme in the preset editor.
- Download
project-preset.jsoninto your app or publish it and copy the preset code. - Use
init --presetfor first setup ortheme addfor a configured app. - Review and accept the file plan; later
addcommands read the saved defaults.
pnpm dlx @ombelle-ui/cli@1.1.2 theme add ./project-preset.jsonTheme installation can affect existing components that use shared variables. It preserves existing component source, scoped recipes, and independently installed preset Buttons.
Apply a preset to one Button
Initialize a supported Radix project first. Save a preset JSON in the invoking folder, then install a separate Button:
pnpm dlx @ombelle-ui/cli@1.1.2 add button --preset ./project-preset.jsonThe CLI prints the generated preset ID/revision directory, scoped CSS, and usage example. Import that generated Button to use it. Your ordinary Button, global theme, and future ordinary additions keep project defaults. Other component IDs are not supported by this command; use their recipe editors instead.
Token order and reproducible output
Values resolve from foundation defaults through style-family defaults, project preset values, supported component defaults, scoped recipe values, and finally your component props and local source. Later layers affect only allowed values; validation and accessibility behavior are not arbitrary token overrides.
Preset JSON includes schemaVersion, id, name, revision, catalogRelease, compilerVersion, platform (react-web), styleFamily, modes, design, and optional componentDefaults. Catalog and compiler references pin the compilation inputs. Unknown keys and values outside supported ranges fail validation.
Keep installed IDs and revisions immutable. When changing an already installed scoped preset, increase its revision before reinstalling changed content. A published code always refers to one fixed snapshot; publish a new snapshot to share edits.
Design value reference
The current preset format is 1.0, or 1.1 for presets that use registry fonts, with catalog/compiler compatibility 0.1.0. Colors are six-digit hex or numeric OKLCH. Each mode defines semantic roles such as background/foreground, card, popover, primary, secondary, muted, accent, destructive, border, input, and ring; optional shadow color controls the family’s shadows.
fontFamilyId: system-sans, system-serif, system-mono, or a self-hosted body font. OptionalheadingFontFamilyIdandmonoFontFamilyIdchoose a display and a code font; a preset that uses any registry font declares schemaVersion 1.1.radiusRem: 0–2 rem.borderWidthPx: 0–4 px.density: comfortable or compact. Shadow X/Y offsets: −16–16 px.motion: full or reduced.transparency: auto or reduced.- Liquid Glass adds blur (0–40 px), opacity (0.25–1), saturation (1–2), backdrop contrast (0.3–1.6), backdrop tone (0–0.6), sheen/rim (0–1), and optional refraction, halo, depth, motion, and dispersion (0–1). Refraction width ranges from 0–0.3.
These are preset ranges; component recipe controls may expose a different supported subset. Use editor validation and the generated recipe JSON as the reference for that component.