Skip to content

Guides

Installation

Package setup for React apps using var-ui.

Installation

Install published @var-ui/* packages from npm. For the copy-paste Vite + React path, start with Getting started.

Packages

PackageRole
@var-ui/coreTokens, recipes, published CSS (@var-ui/core/styles.css), and extract entry (@var-ui/core/styles)
@var-ui/reactReact components
@var-ui/iconsOptional default glyphs for IconProvider
@var-ui/astroAstro components (no React)
@var-ui/cliDev dependency: npx @var-ui/cli for component lookup, search, and init

@var-ui/icons is optional for React. Without it, pass icons={{}} to IconProvider. Astro components load the same default glyphs from @var-ui/icons/glyphs, so install @var-ui/icons alongside @var-ui/astro.

Peer dependencies

PeerNotes
react / react-dom19
react-aria-componentsRequired by @var-ui/react
@internationalized/dateRequired when using date components
typestylesRequired by @var-ui/core, @var-ui/react and @var-ui/astro

typestyles is a peer dependency, not a dependency, so an app (or a workspace that links its own typestyles) never ends up with two runtimes, which would mean two class and token registries.

Advanced: extract CSS

Use this path for custom createDesignTheme modules, app-owned recipes, or tree-shaken CSS. Do not import @var-ui/core/styles.css in the same app — that doubles the stylesheet.

Shell
pnpm add -D @typestyles/vite
TS
// typestyles-entry.ts
import '@var-ui/core/styles';
TS
import typestyles from '@typestyles/vite';

export default {
  plugins: [typestyles({ extract: { modules: ['typestyles-entry.ts'] } })],
};

This monorepo

This repository still links packages with workspace:*. Downstream apps install the published versions from npm and do not use the workspace protocol.