# @superslate/ui — Zag.js + CSS Modules React UI Primitives

> Open-source React 19 UI library built on Zag.js state machines, plain CSS Modules, and OKLCH semantic tokens. Zero Tailwind required. Consume as an npm library or copy uncompiled source into your repository via CLI.

## Install

### Option 1: Copy source into your repo (CLI)

```bash
npx @superslate/ui init
npx @superslate/ui add button dialog select tabs toast
```

### Option 2: Install as an npm package

```bash
npm install @superslate/ui
```

```tsx
import '@superslate/ui/styles.css'
import {Button, Dialog} from '@superslate/ui'
```

## Components (26)

### Zag.js Interactive Primitives (13)

- `accordion` (`@zag-js/accordion`)
- `alert-dialog` (`@zag-js/dialog`, `role="alertdialog"`)
- `checkbox` (`@zag-js/checkbox`)
- `dialog` (`@zag-js/dialog`)
- `drawer` (`@zag-js/dialog`, `left | right | bottom`)
- `menu` (`@zag-js/menu`)
- `pagination` (`@zag-js/pagination`)
- `popover` (`@zag-js/popover`)
- `select` (`@zag-js/select`)
- `switch` (`@zag-js/switch`)
- `tabs` (`@zag-js/tabs`)
- `toast` (`@zag-js/toast`)
- `tooltip` (`@zag-js/tooltip`)

### Core Form & Presentation Primitives (13)

- `alert`
- `avatar`
- `badge`
- `breadcrumb`
- `button`
- `card`
- `empty-state`
- `field`
- `input` (`Input`, `Textarea`)
- `kbd`
- `separator`
- `skeleton`
- `spinner`

## Machine-Readable Registry

- Registry index: [https://superslate.dev/ui/r/registry.json](https://superslate.dev/ui/r/registry.json)
- Per-component JSON: `https://superslate.dev/ui/r/<name>.json` (e.g., `/ui/r/dialog.json`)
- Shared styles and utilities: [https://superslate.dev/ui/r/shared.json](https://superslate.dev/ui/r/shared.json)

## Theme Presets

Neutral light and dark OKLCH tokens ship by default. Import `@superslate/ui/themes.css` and set `data-ui-theme="cobalt"` or `data-ui-theme="stone"` for additional built-in presets.

## Full-Stack SaaS Blocks

Production multi-tenant SaaS compositions built from these primitives — Workspace App Shell, Data Table with filters and pagination, Notification Inbox & Preferences matrix, Auth flows, and Settings & Billing screens — ship source-owned inside [Superslate](https://superslate.dev/?ref=ui).

## Links

- [Interactive Studio](https://superslate.dev/ui/)
- [Source on GitHub](https://github.com/superslate-dev/ui)
- [npm package](https://www.npmjs.com/package/@superslate/ui)
- [Avatar Studio](https://superslate.dev/avatars/) — `@superslate/avatar`
- [Superslate](https://superslate.dev/?ref=ui) — TypeScript SaaS boilerplate for coding agents
- [Live Superslate demo](https://app.superslate.dev/?utm_source=ui&utm_medium=oss)
