Theming

Built-in themes

Wire Vira, Vira Condensed, Sunburst, or Cinder — one preset CSS sheet plus matching Fontsource.

@viraui/foundation ships each built-in brand as one CSS entry (plus JSON and TypeScript for tooling). It does not ship font files. Presets only name families in --font-family-*, so you install the matching Fontsource packages yourself.

Add foundation when you want a built-in brand. Skip it when you want a custom theme.

How a preset wires in

Each preset is a single stylesheet. Load that one file in the app, then the Fontsource packages it names, then @viraui/react/preflight.css, in that order. How you import them (JS side effects, CSS, or your bundler’s usual path) is up to the project, as long as all three end up on the page in sequence.

Switching brands means swapping that theme import (and its fonts) for another, not stacking sheets. Light and dark already live inside the sheet as light-dark() pairs; What is a theme explains how data-mode picks which side resolves.

During Setup, you choose the brand look first; foundation and matching fonts follow that choice. Paste this anytime you need to wire or switch a built-in brand:

Switch this app to a built-in ViraUI brand. Ask which one I want if I haven't said. Wire it so the whole UI picks up that look — one brand at a time, not stacked themes.

Presets

Already bootstrapped?

If Setup ran through the agent and you picked a built-in brand, foundation, fonts, and import order are already wired. Nothing left to do here unless you want to switch presets. Prefer starting with Vira so you learn the system on a known brand; when you are ready to own the look, move on to a custom theme.

Each built-in brand pairs one foundation stylesheet with specific Fontsource packages. Install those families and import their wght.css files after the theme CSS and before preflight. Pick a tab for a live sample of that brand, then copy its packages and import paths.

Install foundation
pnpm add @viraui/foundation

Choose a preset

Fonts for this preset, you can import the web fonts the way you prefer, this is an example with FontSource:

pnpm add @fontsource-variable/geist @fontsource-variable/geist-mono

CSS imports at the app root (theme → fonts → preflight):

import '@viraui/foundation/vira.css';
import '@fontsource-variable/geist/wght.css';
import '@fontsource-variable/geist-mono/wght.css';
import '@viraui/react/preflight.css';

For a brand you own instead of these presets, see Custom themes.

Last updated on

On this page