Docs

Colors

Background levels, foreground, and accent -- all OKLCH with configurable chroma and hue.

0Page base, primary button text
1Body background, panels, header
2Sheets, code blocks, inputs, default buttons
3Table headers, subtle fills
4Hover background
5Active/pressed background
6Separators, inset hover
7Stronger borders, inset active
8Border color
fgPrimary text, primary button bg
mutedSecondary text, labels, captions
accentAccent button, brand color

Contrast

WCAG contrast ratios for foreground/background combinations. AA requires 4.5:1, AAA requires 7:1.

0124fgaccent
ForegroundAaAaAaAaAaAa
MutedAaAaAaAaAaAa
Level 0AaAaAaAaAaAa

Typography

sm — 12px / 18pxThe quick brown fox jumps over the lazy dog
md — 14px / 20pxThe quick brown fox jumps over the lazy dog
lg — 16px / 24pxThe quick brown fox jumps over the lazy dog

Heading 1 — 32px

Heading 2 — 24px

Heading 3 — 20px

Heading 4 — 18px

Spacing

Three height tiers drive all vertical rhythm. Every container -- cells, buttons, inputs -- uses the same sm/md/lg scale.

28px
Small — compact buttons, tab triggers, tags, chips
padding: 4px 8px (gap 8px)
36px
Medium — default buttons, nav links, toolbar items, compact rows
padding: 8px 12px (gap 12px)
44px
Large — inputs, table rows, accordion items, content rows
padding: 12px 16px (gap 16px)

Cell

The core layout primitive. Every row-like element — buttons, list items, menu items, nav links — is a cell. Three optional slots: lead (icon), content (text), trail (action).

Sizes
sm
Small — 28px
md
Medium — 36px
lg
Large — 44px
Modifiers
Truncate — this text is too long and gets clipped with an ellipsis
Centered

Lists

The stack class groups cells into lists with 2px gap spacing. Add stack--tight for 0 gap, stack--padded for 8px padding, stack--nested for indented sub-groups with a connector line.

Navigation
Toolbar
Menu
Tree

Buttons

A button is a cell with visual weight added on top. The btn class adds background, border, radius, and font-weight 500. The cell inside provides the layout — lead, content, trail slots.

Variants at each size
sm
md
lg
With icons at each size
sm
md
lg
Icon-only at each size
sm
md
lg
Disabled
Button group

Sheet

Container surface for cards, panels, and dropdowns. Background level-2, 0.5px inset border, 8px radius. Contains stacks of cells.

Settings panel
Settings

Compositions

Real-world UIs composed from cell, stack, sheet, and btn. Every element on this page is built from the same four primitives.

App sidebar
Workspace
General
Account
Notification
Changes saved
Your settings have been updated successfully.
Comment thread
Alice2m ago
Looks good to me, ship it!
Bob1m ago
Thanks! Merging now.
Card with actions
Deploy preview
Build completed in 12s. All checks passed. Ready to merge into production.

Components

Interactive components powered by the monochrome library.

Accordion

Tabs
Monochrome is a tiny, accessible UI component library using event delegation.
Menu
Collapsible

Tailwind Mapping

Reference for mapping BEM classes to Tailwind equivalents.

BEM ClassTailwind
cellflex items-start gap-2 px-2 py-1 w-full text-left
cell--lgpx-4 py-3 gap-4
cell--interactiverounded hover:bg-gray-100 active:bg-gray-200
cell--activearia-selected:bg-gray-200 aria-expanded:bg-gray-200
cell--mutedtext-gray-500 hover:text-gray-900
cell--truncate[&_.cell\_\_content]:truncate
cell--centeredjustify-center [&_.cell\_\_content]:grow-0
cell__leadh-5 flex shrink-0 items-center [&_svg]:size-3
cell__contentgrow text-sm leading-5
cell__content--smgrow text-xs leading-5 font-medium
cell__trailh-5 flex shrink-0 items-center [&_svg]:size-3
stackflex gap-0.5
stack--verticalflex-col
stack--horizontalinline-flex flex-row [&_.cell]:w-auto
stack--tightgap-0
stack--paddedp-2
stack--nestedml-2 pl-2 border-l
btnfont-medium rounded bg-gray-100 shadow-[inset_0_0_0_0.5px_theme(colors.gray.300)]
btn btn--primarybg-gray-900 text-white hover:opacity-85 active:opacity-75
btn btn--ghostbg-transparent shadow-none
btn btn--iconsize-7 inline-flex items-center justify-center
sheetbg-gray-100 shadow-[inset_0_0_0_0.5px_theme(colors.gray.300)] rounded-lg