Start here

The design system for Matrix OS. One set of tokens, components and rules for every surface, with copy-paste code for each.

Matrix OS runs on many surfaces: the web shell, the desktop app, mobile, macOS and a family of built-in apps. This design system gives all of them one set of tokens, one set of components and one set of rules, so the product feels like a single, calm, capable computer.

Use in your project

Six steps for a Next.js app on Tailwind CSS v4 (the Matrix shell's stack). Each file links to its source on GitHub; copy it as-is.

pnpm add radix-ui class-variance-authority clsx tailwind-merge tw-animate-css lucide-react

1. Add the tokens and the theme

Copy styles/tokens.css (every value: colors, type, spacing, radius, elevation) and styles/theme.css (turns them into Tailwind classes, plus the focus ring) into your app. Then import them after Tailwind in your global CSS:

/* app/globals.css */
@import 'tailwindcss';
@import 'tw-animate-css'; /* menus, select and tooltip animate with it */
@import '../styles/tokens.css';
@import '../styles/theme.css';

If your app already has a shadcn theme (:root color variables and an @theme block), remove it: these files replace it, and two sets would fight over names like --primary.

Now bg-primary, text-ui, rounded-lg, shadow-lg and p-4 work, and plain CSS can use var(--primary), var(--type-ui-size), var(--rounded-lg) or var(--elevation-lg).

2. Load the fonts and the tooltip provider

// app/layout.tsx
import { Bricolage_Grotesque, Geist, Geist_Mono } from 'next/font/google';
import { TooltipProvider } from '@/components/ui/tooltip';

const geist = Geist({ subsets: ['latin'], variable: '--font-geist-sans' });
const geistMono = Geist_Mono({ subsets: ['latin'], variable: '--font-geist-mono' });
const bricolage = Bricolage_Grotesque({ subsets: ['latin'], variable: '--font-bricolage' });

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en" className={`${geist.variable} ${geistMono.variable} ${bricolage.variable}`}>
      <body className="bg-background font-sans text-ui text-foreground">
        <TooltipProvider>{children}</TooltipProvider>
      </body>
    </html>
  );
}

The variable names matter: tokens.css reads --font-geist-sans, --font-geist-mono and --font-bricolage, and falls back to the font names if you load them another way.

TooltipProvider wraps the app once (copy tooltip.tsx in step 5). Tooltips need it, and one shared provider gives them the Matrix timing.

3. Teach cn() the Matrix class names

shadcn's cn() uses tailwind-merge, which doesn't know custom names like text-ui. Without this, cn('text-ui', 'text-muted-foreground') returns only the color and drops the size.

// lib/utils.ts
import { clsx, type ClassValue } from 'clsx';
import { extendTailwindMerge } from 'tailwind-merge';

const twMerge = extendTailwindMerge({
  extend: {
    theme: {
      text: [
        'ui-lg', 'ui', 'ui-sm', 'ui-xs', 'ui-cap',
        'heading', 'heading-sm', 'metric', 'metric-sm',
        'brand-display', 'brand-h1', 'brand-h2', 'brand-h3', 'brand-label',
      ],
      shadow: ['xs-top', '3xl'],
      radius: ['2xs'],
    },
    // Custom utilities that would otherwise be mistaken for text colors.
    classGroups: {
      'text-box': ['text-box-cap'],
    },
  },
});

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

4. Add icons

pnpm add lucide-react

Copy components/ui/icon.tsx. It sets the Matrix icon sizes and stroke, so you never pass pixels or strokeWidth:

import { Mail } from 'lucide-react';
import { Icon } from '@/components/ui/icon';

// 20px, the default
<Icon icon={Mail} />

// 16px, next to small text
<Icon icon={Mail} size="sm" />

5. Add components

Copy the files you need from components/ui, with the ones they depend on. They keep shadcn's names and parts, so they replace shadcn's versions one for one.

ComponentAlso copy
Avatar, Checkboxicon.tsx
Fieldlabel.tsx, separator.tsx
Input groupbutton.tsx, input.tsx, textarea.tsx
Select, Dropdown menumenu-styles.ts
Tooltipadd TooltipProvider to the layout (step 2)

In every copied file, cn comes from @/lib/utils (step 3). If you use the shadcn CLI instead, run pnpm dlx shadcn@latest add <name> first and then replace the file; delete any theme it writes into your global CSS, since step 1 already provides it.

6. Check it works

<div className="flex max-w-sm flex-col gap-2 rounded-xl border border-border bg-card p-6 shadow-xs">
  <h2 className="text-heading">Agents</h2>
  <p className="text-ui text-muted-foreground">Connect a model to start.</p>
  <button className="mt-2 w-fit rounded-md bg-primary px-4 py-2 text-ui font-medium text-primary-foreground">
    Connect
  </button>
</div>

A card with a 17px semibold title, grey 14px text and a warm dark grey button (#242323) means everything is wired.

  • The button has no background, or a different color: step 1 is missing, or an old theme still overrides --primary.
  • The text is a system font instead of Geist: step 2 is missing or uses different variable names.

Foundations

Components

Source of truth

This design system is the source of truth. Every color, size and rule lives in styles/tokens.css and on these pages; the product, Figma and other docs follow it.

It started from two references:

  • The Figma brand files, where the brand color scales came from
  • DESIGN.md in the Matrix OS repository, for principles, radius and the brand type scale

When they disagree with this site, this site wins: update the reference, never the other way round. Never create another token set.

Principles

Expressive, not ornamental

Personality comes from type and color, never from decoration without purpose.

Calm, not empty

Clear hierarchy and generous space keep people focused.

Organic, not rustic

Rounded geometry and living colors that still feel precise.

Technical, not intimidating

Machine information is legible and direct.

Bright, not childish

Supporting colors are signals, not confetti.

Status

Light mode is in place: all foundations (colors, typography, spacing, radius, elevation, iconography) and 11 components (Avatar, Badge, Button, Checkbox, Dropdown menu, Field, Input, Radio group, Select, Switch, Tooltip). Coming next: more components (Card, Dialog, Tabs, Textarea), motion and dark mode.