Getting started

Theming

Every component takes its colors, corners, type and motion from a few CSS variables in tokens.css. Change them once and everything follows.

Try it

Accent
Preview in

Manuscript · MS-1021

Book of Optics

Read
Optics Cairo 2 waiting
Borrow for

Add your choice after tokens.css:

:root {
	--ui-accent: light-dark(#047857, #34d399);
	--ui-on-accent: light-dark(#ffffff, #022c22);
	--ui-radius: 0.5rem;
	--ui-radius-control: 0.5rem;
}

Corners

Surfaces and controls round separately. --ui-radius shapes cards, menus and dialogs; --ui-radius-control shapes buttons, fields and tags. Set the control radius to 999px for pill-shaped controls while cards keep their corners.

Dark mode

Every color is a light-dark() pair, so pages follow the reader's system setting. To let people choose, set data-theme="light" or "dark" on <html>.

When you change a color, give both halves: light-dark(#4338ca, #a5b4fc). Check that text on it reads at 4.5:1 in each.

Type

Components use --ui-font for text and --ui-font-mono for code. Load your fonts as usual, then point these at them.

Text inside components follows your page's font. tokens.css sets the page to --ui-font only when your app doesn't set its own. If it does (Tailwind sets one), the components take your app's font. To use --ui-font everywhere, add html { font-family: var(--ui-font); } after your own CSS.

With Tailwind

Components work alongside Tailwind's reset with nothing to configure: they set their own borders, spacing and list styles. Their CSS is scoped, so Tailwind classes in your markup don't change them.

All tokens

TokenUsed for
--ui-bgThe page
--ui-surfaceCards, menus, dialogs
--ui-fgText
--ui-mutedSecondary text
--ui-subtleQuiet fills: tags, tracks, hover rows
--ui-hoverA step stronger than subtle
--ui-lineHairlines between things
--ui-field-lineText field borders
--ui-control-lineCheckbox and radio outlines
--ui-accentBrand color: primary buttons, focus, selection
--ui-on-accentText on the accent
--ui-dangerErrors and destructive actions
--ui-on-dangerText on danger
--ui-warningWarnings
--ui-backdropBehind dialogs
--ui-ringFocus ring color (the accent)
--ui-ring-widthFocus ring thickness
--ui-ring-offsetGap between ring and control
--ui-radiusCorners of surfaces: cards, menus, dialogs
--ui-radius-controlCorners of controls: buttons, fields, tags; 999px for pills
--ui-shadow-cardResting cards
--ui-shadow-overlayMenus, popovers, dialogs
--ui-fontText
--ui-font-monoCode and numbers
--ui-ease-outThings arriving
--ui-ease-in-outThings moving on screen
--ui-ease-drawerSheets and drawers
--ui-dur-pressPress feedback
--ui-durMost transitions
--ui-dur-overlayOverlays opening
Introduction
Theming
Changelog
Button
Action button
Confirm button
Copy button
Hold to confirm
Split button
Calendar
Checkbox
Color picker
Combobox
Date picker
Date range picker
File drop
Form
Input
Mention input
Multi select
Number field
OTP input
Password input
Phone input
Radio cards
Radio group
Rich text editor
Search field
Segmented control
Select
Signature pad
Slider
Switch
Tag input
Upload
Wheel picker
Textarea
Time field
Toggle group
Toolbar
Alert dialog
Command palette
Context menu
Dialog
Drawer
Dropdown
Hover card
Popover
Tooltip
Announcement bar
Alert
Empty state
Meter
Progress
Rolling number
Skeleton
Spinner
Toast
Avatar
Avatar group
Badge
Card
Carousel
Chart
Chat
Code block
Data table
Folder
Kbd
Mind map
Resizable panels
Scroll area
Separator
Sortable
Table
Tag group
Virtual list
Audio player
Image
Image compare
Video
Visualizer
Breadcrumb
File tree
Menubar
Navigation menu
Pagination
Sidebar layout
Stepper
Tabs
Alarm clock
Clock
Dynamic island
Fluid orb
Hourglass
Stopwatch
Timer
AI chat
AI media
Auth
Board
Booking
Dashboard
File explorer
Messaging
Notifications
Settings
Team
Overview
Pricing
Agent chat
Calendar
Voice agent
Mail inbox
CMS
Blog
Marketing site
E-commerce
AI agents
SaaS landing page
SaaS app
Accordion
Dark theme
Light theme