Sina UI

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.

npx sinaui init adds the tokens to your project; see Installation.

Accent color

Sina UI is monochrome by default: the accent is the text ink. For color, set data-accent on <html> to blue, orange, lime, emerald, pink or sky, and mono on a part that should stay in ink. Primary buttons, checked controls, focus rings, links, sliders and the first chart series all follow it. Set it on any container instead to color just that part of a page.

Try one: the whole site follows.
<html data-accent="blue">

Each preset passes 4.5:1 as text on the page and under the text of a filled button, in light and dark. Svelte's orange, #ff3e00, reads at only 3.5:1 on white, so in light mode the orange preset takes a deeper step of it. For a color of your own, set --ui-accent and --ui-on-accent, with a light and a dark half (see Dark mode).

Corners

Every corner is square by default, an editorial look. Surfaces and controls round separately: --ui-radius shapes cards, menus and dialogs, --ui-radius-control buttons and fields, and --ui-radius-pill tags, badges and tracks. For a softer look, set them to 0.75rem, 0.5rem and 999px. Circles, like avatars and radio buttons, stay round.

Size

Fields, selects, medium buttons and tabs share one height, --ui-control-h, and one text size, --ui-control-font, so a form lines up at any size. For a compact interface, set them inside @media (pointer: fine): touch screens keep 44px targets, and iOS Safari zooms into any field with text under 16px. Small and large buttons follow --ui-control-h-sm and --ui-control-h-lg, button text --ui-button-font, and on touch screens every control is --ui-control-h-touch tall.

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, numbers and small labels. The defaults are Mona Sans and Geist Mono; load them (both are free on Fontsource) or point these at your own fonts.

Headings get their hierarchy from weight and width, not color: bold, and narrowed on Mona Sans's width axis through --ui-heading-stretch. A font without a width axis ignores it.

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.

For a display face on titles (dialogs, drawers, cards, alerts, empty states), set --ui-font-heading. Left unset, titles follow the text around them.

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-field-bgFields: inputs, selects, checkboxes, drop zones (white)
--ui-fgText
--ui-mutedSecondary text
--ui-faintThe faintest fill: toolbar groups, idle stat tabs
--ui-subtleQuiet fills: tags, tracks, the current row
--ui-hoverA step stronger than subtle
--ui-lineHairlines between things
--ui-field-lineBorders of fields, buttons and cards
--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-chart-1First chart series (the accent)
--ui-chart-2 … 6The other chart series, in order
--ui-radiusCorners of surfaces: cards, menus, dialogs (square by default)
--ui-radius-controlCorners of controls: buttons, fields (square by default)
--ui-radius-pillCorners of tags, badges and tracks; 999px for pills
--ui-control-hHeight of fields, selects, medium buttons and tabs
--ui-control-h-smHeight of small buttons
--ui-control-h-xsHeight of extra-small buttons (24px with a mouse)
--ui-control-h-lgHeight of large buttons
--ui-control-h-touchHeight of every control on touch screens (44px or more)
--ui-button-fontText size of medium buttons
--ui-control-fontText size inside fields (16px or more on touch: iOS zooms smaller)
--ui-shadow-cardResting widgets and blocks: none by default
--ui-card-lineCard: its outline and its inner sheet’s hairline (unset: --ui-line)
--ui-shadow-overlayMenus, popovers, dialogs
--ui-fontText
--ui-font-sizeEveryday text: labels, menus, lists (14px with a mouse)
--ui-item-hHeight of a menu or list row (32px with a mouse)
--ui-font-monoCode and numbers
--ui-font-headingTitles of dialogs, cards, alerts; unset, they follow the text
--ui-heading-weightHeadings: weight (700)
--ui-heading-stretchHeadings: width on Mona Sans’s width axis (88%)
--ui-heading-trackingHeadings: letter spacing
--ui-label-fontSmall labels and group titles: font (mono)
--ui-label-caseSmall labels: letter case (uppercase)
--ui-label-trackingSmall labels: letter spacing
--ui-sidebar-bgSidebar layout: the sidebar
--ui-sidebar-lineSidebar layout: its edges (a hairline by default)
--ui-sidebar-current-bgSidebar layout: the current page
--ui-sidebar-current-fgSidebar layout: the current page’s text
--ui-sidebar-wSidebar layout: its open width
--ui-button-pad-lgButton: a large button’s side padding
--ui-button-depthButton: a raised edge the button presses into (0 is flat)
--ui-sidebar-item-hSidebar layout: the height of each page row
--ui-sidebar-fontSidebar layout: the page rows’ text size
--ui-sidebar-title-fontSidebar layout: the group titles’ text size
--ui-sidebar-title-familySidebar layout: the group titles’ font (the label font)
--ui-sidebar-title-caseSidebar layout: the group titles’ letter case (none or uppercase)
--ui-sidebar-title-trackingSidebar layout: the group titles’ letter spacing
--ui-sheet-widthDialog: a side sheet’s width
--ui-sheet-insetDialog: room a side sheet leaves beside it on narrow screens
--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
Theme toggle
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
Account menu
Dropdown
Hover card
Popover
Tooltip
Announcement bar
Alert
Empty state
Meter
Progress
Rolling number
Skeleton
Spinner
Toast
Avatar
Avatar group
Badge
Card
Carousel
Chart
Sparkline
World map
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
Docs navigation
Menubar
Navigation menu
Pagination
Sidebar layout
Stat tabs
Stepper
Tabs
Table of contents
Alarm clock
Clock
Dynamic island
Fluid orb
Hourglass
Stopwatch
Timer
AI chat
AI media
Auth
Board
Booking
Dashboard
Docs
File explorer
Messaging
Notifications
Settings
Studio
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