Introduction

Cubix is a set of accessible, token-driven React components and the system that distributes them. Three primitive bases, one visual API, and source you own. Open source. Open code.

Cubix is not a component library you install. It is the foundation you build your own component library on.

Most UI kits follow the same pattern: install a package, import its components, and use them as-is. That works until the product needs something the package did not plan for - a different interaction model, a layout the API cannot express, or a control that is simply missing.

From there, teams wrap components, override styles with ever more specific selectors, or mix libraries with incompatible APIs. The UI layer slowly becomes the part of the codebase nobody wants to touch.

Cubix is built to avoid that. 55 production-ready components today, each available on three accessibility backends, all shaped by a few principles:

Open code

The CLI copies real TypeScript files into components/cubix. Nothing is compiled away or hidden behind a package boundary, which means:

  • Full transparency - markup, variants, ARIA wiring, and data-slot structure are all visible.
  • Direct customization - to change how a button behaves, edit components/cubix/button.tsx. No wrapper, no style overrides.
  • No upstream lock-in - a one-line fix never waits on someone else's release.
How do I pick up upstream updates?
Run cubix-ui view <name> to inspect the latest registry version, compare it with your local file, and merge what you want. cubix-ui add never replaces an existing file unless you pass --overwrite, so your edits stay safe.

One API, three bases

Teams standardize on different accessibility primitives for good reasons. Cubix treats all three as first-class: every component ships for each base with identical props, variants, tokens, and slot names, so screens do not change when the primitive underneath does.

BaseFlagChoose it when
Base UIbase (default)Starting a new project and want the default Cubix stack.
React Aria--base ariaYour team already relies on React Aria hooks and behaviors.
Radix UI--base radixYour app is built on Radix primitives and you want to keep them.

Set the default in cubix.json, or override it for a single install:

pnpm dlx cubix-ui@latest add dialog --base aria

Every component page includes a base switcher, so you can compare the source for each backend side by side.

Design tokens

Components never reach for a hardcoded color. They speak a small set of semantic tokens, defined as oklch values for light and dark mode in globals.css:

  • background

    Page surface

  • foreground

    Primary text

  • muted

    Subtle surfaces

  • accent

    Hover and selection

  • primary

    Brand actions

  • destructive

    Errors and danger

  • border

    Dividers and outlines

  • input

    Form control borders

  • ring

    Focus indicators

Restyle the entire product by editing variables, and open component files only when structure or behavior must change. The full map lives in Theming.

Agent interfaces

Chat and agent products need more than forms and dialogs. Cubix is building a dedicated set of agent surfaces that handle the hard states - streaming, partial output, tool failures, and long transcripts - not just the happy path:

  • Conversation

    In progress

    Top-level chat shell that sticks to the latest turn, with empty, scroll, streaming, and download controls.

  • Message Scroller

    In progress

    Chat transcript scroller for turn anchoring, streaming follow, history restore, and jump controls.

  • Prompt Input

    In progress

    AI prompt composer with actions, file attachments, and submit controls.

  • Streaming Text

    In progress

    Progressive text surface for token-by-token model output during a stream.

  • Thinking

    In progress

    Collapsible block for model reasoning and chain-of-thought while a reply is prepared.

  • Tool Call

    In progress

    Visualize tool and function invocations with status, args, and results.

  • Sources

    In progress

    Citation list for retrieved documents and grounded answer references.

  • Branch

    Navigate alternate reply branches when regenerating or editing a turn.

Each surface follows the same rules as every other Cubix component: owned source, three bases, semantic tokens. Track progress on the Changelog.

Typeset

Markdown, CMS content, and model output arrive as unstyled HTML. Typeset gives them one shared rhythm: semantic type roles, a reading measure, and presets driven by three controls - size, leading, and flow.

Spacing runs in one direction, so a streaming reply can append new blocks without reflowing the ones above it. The presets are plain CSS in your project - this page uses the docs-prose preset. Read more in Typeset.

RTL and locale

Bidirectional layout is part of the system, not a patch on top of it. Components use logical properties (ps-*, me-*, start, end), so they mirror correctly under dir="rtl" without extra classes.

Persian content under [lang=fa] uses IRANSans XV with baseline-corrected metrics and tuned leading, while type sizes stay identical to the documented scale across locales.

Distribution

Cubix is also a code distribution system, made of two parts:

  • Registry schema - a flat-file JSON format that lists each item's files, dependencies, and base variants.
  • CLI - init, add, view, search, build, and info for installing, inspecting, and publishing items.

Use the same schema to publish your own components to other projects. See CLI and Registry.

AI-ready

Open source and a consistent API make Cubix easy for assistants to read and extend. Cubix goes further by giving them project context: cubix.json and cubix-ui info expose your framework, aliases, base, and installed components.

Install the Cubix Skills and connect MCP so the assistant uses the right imports, the right base, theme tokens, and live registry tools - on the first try.

Quick start

Initialize Cubix in the root of your app. This writes the design tokens, creates lib/utils.ts, and adds cubix.json:

pnpm dlx cubix-ui@latest init

Then add your first component:

pnpm dlx cubix-ui@latest add button

The full walkthrough, including manual setup, is in Installation.

Framework support

Cubix is React source plus Tailwind CSS, not a closed runtime. It runs anywhere you can render React.

Requirements: React 18+ (React 19 recommended), Tailwind CSS v4, and TypeScript.

Next steps