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-react1. 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-reactCopy 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.
| Component | Also copy |
|---|---|
| Avatar, Checkbox | icon.tsx |
| Field | label.tsx, separator.tsx |
| Input group | button.tsx, input.tsx, textarea.tsx |
| Select, Dropdown menu | menu-styles.ts |
| Tooltip | add 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
Colors
Brand scales, semantic roles, tints. Neutral actions, coral for danger.
Typography
Geist product scale, weights, the Bricolage brand scale.
Spacing
The 4px scale and border widths.
Radius
Corners from 2px to a pill, chosen by the element's size.
Elevation
Seven shadow steps; xs, lg and xl do most of the work.
Iconography
Lucide at five sizes, with a stroke floor.
Components
Button
Primary, secondary, ghost, link and destructive, four sizes.
Input and Field
Text fields with labels, help text and errors.
Checkbox, Radio, Switch
Choices and settings.
Select and Dropdown menu
Picking a value, and menus of actions.
Tooltip
Short hints on hover and focus.
Avatar and Badge
People, and status labels.
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.mdin 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.