Navigation

v2.1.0
2.0Native HTML and CSS components

Craft the most refined interfaces, natively.

Native elements and modern CSS do the work: dialogs, menus, tooltips and selects open, anchor and animate with zero JavaScript to start.

Get started

Platform

Modern CSS and the platform do the work.

Where the browser has an element or a feature for the job, the component uses it. Try each one: none of them loads a script.

Browser support
  • Slides with buttons and dots, drawn by the browser

    A row of slides snaps into place, and the browser adds previous and next buttons and a dot for each slide.

    ::scroll-button() ::scroll-marker scroll-snap

  • atlas.dev

    Production · 3 changes waiting

    • ALTighten the card's inset on phonesa1f9e2cReady
    • GHDraw the toast's clock as a hairline7c04b1dReady
    • ATGlide the segmented thumbe55d0a8Building

    Publish to production?

    The three changes on main go live on atlas.dev at once. The current deployment stays one click away.

    A modal from three attributes

    Publish opens a modal that keeps focus inside, closes on Escape or the scrim, eases in and out, and hands focus back.

    <dialog> commandfor closedby @starting-style

  • brand-guidelines.pdf

    4.2 MB · edited 2h ago

    A menu against its button

    It opens beside the button, turns back at the viewport edge and closes on Escape or a click outside.

    popover position-area

  • Bold ⌘B
    Italic ⌘I
    Inline code ⌘E

    Tooltips on hover and focus

    Each tool names itself and its key on hover or keyboard focus, and stays out of the way of the click.

    popover="hint" interestfor

  • Requests

    1.28M this week · up 12.4%

    A thumb that glides, bars that rise

    The segmented thumb is drawn on an anchor and glides to the current option; the bars rise from the baseline as they arrive.

    anchor-scope anchor() @starting-style

  • Functions run here first; the edge serves the rest.

    A native select, in the material

    The list opens on the floating sheet, anchored to the control, with a check beside the current option.

    appearance: base-select ::picker(select)

  • Design review

    #interface · 3 members

    1. AL

      Ada Lovelace

      The focus ring is cut by the mask on the code panel. Should it move to the group?

    2. AT

      Alan Turing

      Yes. The group already has the corner, so the ring follows it.

    Enter to send

    A field that grows with what you write

    The composer starts at one line and grows to ten as you type, then scrolls; the thread above stays put.

    field-sizing: content

  • Does it need JavaScript?
    No. Each component is a native element with one stylesheet; the browser keeps its behavior.
    Can I change the corners?
    Set --corner-scale and --corner-shape once, and every component follows.
    Is dark mode a second stylesheet?
    No. Every color token resolves with light-dark() and follows the page's color scheme.

    An accordion that eases open

    Rows sharing a name close each other, and each panel eases to its height with interpolate-size.

    ::details-content interpolate-size details[name]

  • A filled track from the thumb

    A scroll-driven animation reads where the thumb is and fills the track up to it.

    view-timeline timeline-scope

Customize

Same markup, your material.

Colors, corners and shadows come from the theme’s tokens: retune the library instead of overriding it.

Choose a customization
An engraving of the lake under a red sun, hatched in ink on cream paper

Lake Ilse loop

6.2 km · 2 h 10 min

Open
  1. Boathouse

    Start · 0.0 km

    1,430 m
  2. Larch ridge

    2.6 km

    1,618 m
  3. Summit

    4.1 km

    1,842 m
A survey drawing of the lake loop in cyan ridgelines on navy, its three stops marked in amber

Lake Ilse loop

6.2 km · 2 h 10 min

Open
  1. Boathouse

    Start · 0.0 km

    1,430 m
  2. Larch ridge

    2.6 km

    1,618 m
  3. Summit

    4.1 km

    1,842 m
A pastel morning on the lake, the boathouse and the summit fading into a lilac sky

Lake Ilse loop

6.2 km · 2 h 10 min

Open
  1. Boathouse

    Start · 0.0 km

    1,430 m
  2. Larch ridge

    2.6 km

    1,618 m
  3. Summit

    4.1 km

    1,842 m
A screen print of the lake: a black summit, a striped yellow sun on red, a yellow boathouse on blue water

Lake Ilse loop

6.2 km · 2 h 10 min

Open
  1. Boathouse

    Start · 0.0 km

    1,430 m
  2. Larch ridge

    2.6 km

    1,618 m
  3. Summit

    4.1 km

    1,842 m

Styles

themes/editorial.css51 tokens

/* themes/editorial.css, imported after '@master/ui' */@theme {  /* Type */  --font-sans: 'Iowan Old Style', Charter, Georgia, serif;  --font-weight-control: 400;   /* Shape: tight corners, and nothing travels */  --radius-chip: .125rem;  --radius-control-sm: .125rem;  --radius-control: .1875rem;  --radius-control-lg: .25rem;  --radius-surface: .25rem;  --lift: 0px;   /* Surfaces: cream paper, and newsprint at night */  --color-surface-base: light-dark(oklch(96.4% .014 84), oklch(19.5% .008 70));  --color-surface-raised: light-dark(oklch(98.6% .009 86), oklch(22.5% .009 70));  --color-surface-raised-low: var(--color-surface-raised);  --color-surface-inset: light-dark(oklch(94.4% .016 84), oklch(17% .008 70));  --color-surface-inset-hover: light-dark(oklch(92.8% .018 84), oklch(15.8% .008 70));  --color-surface-chip: light-dark(oklch(93.4% .017 84), oklch(100% 0 none / .07));  --color-surface-inverse: light-dark(oklch(44% .15 27), oklch(68% .14 30));   /* Lines carry every edge */  --color-line-hair: light-dark(oklch(25% .02 60 / .14), oklch(95% .02 84 / .13));  --color-line-contour: light-dark(oklch(25% .02 60 / .3), oklch(95% .02 84 / .26));  --color-line-divider: light-dark(oklch(25% .02 60 / .22), oklch(95% .02 84 / .2));  --color-line-strong: light-dark(oklch(25% .02 60 / .5), oklch(95% .02 84 / .44));  --color-line-mark: light-dark(oklch(25% .02 60 / .75), oklch(95% .02 84 / .66));   /* Ink: warm black, and an oxblood accent */  --color-text-strong: light-dark(oklch(21% .014 55), oklch(94% .014 84));  --color-text-body: light-dark(oklch(33% .016 55), oklch(84% .014 84));  --color-text-muted: light-dark(oklch(46% .018 60), oklch(71% .014 80));  --color-text-inverse: light-dark(oklch(97.5% .01 84), oklch(18% .01 40));  --color-focus: var(--color-text-strong);  --color-ink-high: var(--color-surface-inverse);  --color-ink-low: var(--color-surface-inverse);  --color-ink-high-hover: light-dark(oklch(49% .16 27), oklch(73% .13 30));  --color-ink-low-hover: var(--color-ink-high-hover);  --color-ink-pressed: light-dark(oklch(39% .14 27), oklch(62% .14 30));  --color-ink-highlight: transparent;  --color-ink-edge: transparent;   /* Depth: a rule, not a shadow */  --color-highlight: transparent;  --color-lip: transparent;  --color-shade-1: transparent;  --color-shade-2: transparent;  --color-shade-3: transparent;  --color-shade-4: transparent;  --color-shade-5: transparent;  --shadow-pressed: inset 0 0 0 1px var(--color-line-contour);  --shadow-flat: 0 0 0 1px var(--color-line-contour);  --shadow-raised: 0 0 0 1px var(--color-line-strong);  --shadow-raised-hover: 0 0 0 1px var(--color-line-mark);  --shadow-lifted: 0 0 0 1px var(--color-line-contour);  --shadow-ink: 0 0 0 0 transparent;  --shadow-ink-hover: 0 0 0 0 transparent;  --shadow-ink-pressed: 0 0 0 0 transparent;  --shadow-ink-well: 0 0 0 0 transparent;  --shadow-thumb-on-ink: 0 0 0 0 transparent;} /* Circles in place of squircles */:root {  --corner-shape: round;  --corner-scale: 1;}

themes/technical.css51 tokens

/* themes/technical.css, imported after '@master/ui' */@theme {  /* Type: load the font before selecting it */  --font-sans: 'IBM Plex Mono', ui-monospace, monospace;  --font-weight-control: 500;   /* Shape: square, and nothing travels */  --radius-chip: 0;  --radius-control-sm: 0;  --radius-control: 0;  --radius-control-lg: 0;  --radius-surface: 0;  --lift: 0px;   /* Surfaces: drafting film, and a navy console */  --color-surface-base: light-dark(oklch(96.8% .005 240), oklch(17.5% .014 250));  --color-surface-raised: light-dark(oklch(99.5% .002 240), oklch(21% .016 250));  --color-surface-raised-low: var(--color-surface-raised);  --color-surface-inset: light-dark(oklch(95% .006 240), oklch(15% .014 250));  --color-surface-inset-hover: light-dark(oklch(93.5% .007 240), oklch(13.8% .014 250));  --color-surface-chip: light-dark(oklch(94% .008 240), oklch(100% 0 none / .07));  --color-surface-inverse: light-dark(oklch(52% .2 258), oklch(76% .13 236));   /* Lines: crisp, and a step cooler */  --color-line-hair: light-dark(oklch(30% .03 250 / .12), oklch(85% .05 240 / .12));  --color-line-contour: light-dark(oklch(30% .03 250 / .26), oklch(85% .05 240 / .24));  --color-line-divider: light-dark(oklch(30% .03 250 / .18), oklch(85% .05 240 / .17));  --color-line-strong: light-dark(oklch(30% .03 250 / .42), oklch(85% .05 240 / .38));  --color-line-mark: light-dark(oklch(30% .03 250 / .62), oklch(85% .05 240 / .6));   /* Ink: cobalt for what is on */  --color-text-strong: light-dark(oklch(20% .02 255), oklch(95% .01 240));  --color-text-body: light-dark(oklch(35% .02 255), oklch(82% .015 240));  --color-text-muted: light-dark(oklch(49% .02 250), oklch(69% .02 240));  --color-text-inverse: light-dark(oklch(99% 0 none), oklch(16% .02 250));  --color-focus: var(--color-surface-inverse);  --color-ink-high: var(--color-surface-inverse);  --color-ink-low: var(--color-surface-inverse);  --color-ink-high-hover: light-dark(oklch(57% .2 258), oklch(81% .11 236));  --color-ink-low-hover: var(--color-ink-high-hover);  --color-ink-pressed: light-dark(oklch(46% .19 258), oklch(70% .13 236));  --color-ink-highlight: transparent;  --color-ink-edge: transparent;  --color-thumb-on-high: light-dark(oklch(100% 0 none), oklch(16% .02 250));  --color-thumb-on-low: var(--color-thumb-on-high);   /* Depth: one 1px line */  --color-highlight: transparent;  --color-lip: transparent;  --color-shade-1: transparent;  --color-shade-2: transparent;  --color-shade-3: transparent;  --color-shade-4: transparent;  --color-shade-5: transparent;  --shadow-pressed: inset 0 0 0 1px var(--color-line-contour);  --shadow-flat: 0 0 0 1px var(--color-line-contour);  --shadow-raised: 0 0 0 1px var(--color-line-strong);  --shadow-raised-hover: 0 0 0 1px var(--color-line-mark);  --shadow-lifted: 0 0 0 1px var(--color-line-strong);  --shadow-ink: 0 0 0 0 transparent;  --shadow-ink-hover: 0 0 0 0 transparent;  --shadow-ink-pressed: 0 0 0 0 transparent;  --shadow-ink-well: 0 0 0 0 transparent;  --shadow-thumb-on-ink: 0 0 0 0 transparent;}

themes/soft.css42 tokens

/* themes/soft.css, imported after '@master/ui' */@theme {  /* Type: the font you have, a step heavier */  --font-weight-control: 520;   /* Shape: controls round off to pills */  --radius-chip: .75rem;  --radius-control-sm: 1rem;  --radius-control: 1.1875rem;  --radius-control-lg: 1.375rem;  --radius-surface: 1.75rem;  --lift: 1px;   /* Surfaces: lavender, and plum at night */  --color-surface-base: light-dark(oklch(96.6% .016 300), oklch(20.5% .03 295));  --color-surface-raised: light-dark(oklch(99.6% .004 300), oklch(27% .035 295));  --color-surface-raised-low: light-dark(oklch(98.2% .009 300), oklch(25% .034 295));  --color-surface-inset: light-dark(oklch(94.6% .02 300), oklch(18.5% .03 295));  --color-surface-inset-hover: light-dark(oklch(93.2% .024 300), oklch(17.2% .03 295));  --color-surface-chip: light-dark(oklch(94.4% .02 300), oklch(100% 0 none / .08));  --color-surface-inverse: light-dark(oklch(55% .19 292), oklch(80% .11 292));   /* Lines: faint, and tinted */  --color-line-hair: light-dark(oklch(35% .1 295 / .08), oklch(92% .05 295 / .09));  --color-line-contour: light-dark(oklch(35% .1 295 / .12), oklch(92% .05 295 / .14));  --color-line-divider: light-dark(oklch(35% .1 295 / .1), oklch(92% .05 295 / .12));  --color-line-strong: light-dark(oklch(35% .1 295 / .2), oklch(92% .05 295 / .22));  --color-line-mark: light-dark(oklch(35% .1 295 / .34), oklch(92% .05 295 / .36));   /* Ink: violet for what is on */  --color-text-strong: light-dark(oklch(25% .05 295), oklch(95% .02 300));  --color-text-body: light-dark(oklch(40% .05 295), oklch(84% .03 300));  --color-text-muted: light-dark(oklch(51% .05 295), oklch(73% .04 300));  --color-text-inverse: light-dark(oklch(99% .005 300), oklch(20% .04 295));  --color-focus: var(--color-surface-inverse);  --color-ink-high: light-dark(oklch(62% .18 292), oklch(86% .09 292));  --color-ink-low: light-dark(oklch(53% .2 290), oklch(77% .12 290));  --color-ink-high-hover: light-dark(oklch(66% .17 292), oklch(89% .08 292));  --color-ink-low-hover: light-dark(oklch(57% .19 290), oklch(81% .11 290));  --color-ink-pressed: light-dark(oklch(48% .19 290), oklch(72% .13 290));  --color-ink-edge: light-dark(oklch(46% .18 290), oklch(0% 0 none / .4));  --color-thumb-on-high: light-dark(oklch(100% 0 none), oklch(22% .04 295));  --color-thumb-on-low: light-dark(oklch(97% .01 300), oklch(20% .04 295));   /* Depth: wide, tinted shade */  --color-shade-1: light-dark(oklch(40% .12 295 / .07), oklch(5% .02 295 / .45));  --color-shade-2: light-dark(oklch(40% .12 295 / .07), oklch(5% .02 295 / .36));  --color-shade-3: light-dark(oklch(40% .12 295 / .08), oklch(5% .02 295 / .32));  --color-shade-4: light-dark(oklch(40% .12 295 / .1), oklch(5% .02 295 / .32));  --color-shade-5: light-dark(oklch(40% .12 295 / .14), oklch(5% .02 295 / .4));  --shadow-raised: inset 0 1px 0 var(--color-highlight), 0 0 0 .5px var(--color-line-contour), 0 2px 6px -2px var(--color-shade-1), 0 8px 18px -8px var(--color-shade-3);  --shadow-raised-hover: inset 0 1px 0 var(--color-highlight), 0 0 0 .5px var(--color-line-strong), 0 4px 10px -3px var(--color-shade-2), 0 14px 28px -10px var(--color-shade-4);  --shadow-lifted: inset 0 1px 0 var(--color-highlight), 0 0 0 .5px var(--color-line-contour), 0 6px 16px -6px var(--color-shade-2), 0 28px 60px -24px var(--color-shade-5);  --shadow-ink: inset 0 1px 0 oklch(100% 0 none / .3), 0 0 0 .5px var(--color-ink-edge), 0 6px 16px -6px light-dark(oklch(50% .2 290 / .55), oklch(0% 0 none / .5));  --shadow-ink-hover: inset 0 1px 0 oklch(100% 0 none / .34), 0 0 0 .5px var(--color-ink-edge), 0 10px 22px -8px light-dark(oklch(50% .2 290 / .6), oklch(0% 0 none / .55));}

themes/bold.css52 tokens

/* themes/bold.css, imported after '@master/ui' */@theme {  /* Type: the font you have, at its boldest */  --font-weight-control: 700;   /* Shape: plain circular corners, and a long press */  --radius-chip: .25rem;  --radius-control-sm: .375rem;  --radius-control: .5rem;  --radius-control-lg: .625rem;  --radius-surface: .75rem;  --lift: 2px;   /* Surfaces: butter and white, or black */  --color-surface-base: light-dark(oklch(95.5% .04 92), oklch(16% .005 280));  --color-surface-raised: light-dark(oklch(100% 0 none), oklch(22% .006 280));  --color-surface-raised-low: var(--color-surface-raised);  --color-surface-inset: light-dark(oklch(93% .045 92), oklch(14% .005 280));  --color-surface-inset-hover: light-dark(oklch(90.5% .055 92), oklch(12% .005 280));  --color-surface-chip: light-dark(oklch(92% .05 92), oklch(100% 0 none / .1));  --color-surface-inverse: oklch(87% .175 95);   /* Lines: solid ink, 2px wide */  --color-line-hair: light-dark(oklch(15% 0 none / .2), oklch(96% .02 95 / .2));  --color-line-contour: light-dark(oklch(15% 0 none), oklch(96% .02 95));  --color-line-divider: light-dark(oklch(15% 0 none / .35), oklch(96% .02 95 / .3));  --color-line-strong: var(--color-line-contour);  --color-line-mark: var(--color-line-contour);   /* Ink: yellow for what is on, in both schemes */  --color-text-strong: light-dark(oklch(15% 0 none), oklch(97% .02 95));  --color-text-body: light-dark(oklch(22% 0 none), oklch(90% .02 95));  --color-text-muted: light-dark(oklch(38% .01 90), oklch(77% .02 95));  --color-text-inverse: oklch(15% 0 none);  --color-focus: light-dark(oklch(15% 0 none), oklch(87% .175 95));  --color-ink-high: var(--color-surface-inverse);  --color-ink-low: var(--color-surface-inverse);  --color-ink-high-hover: oklch(90% .16 95);  --color-ink-low-hover: var(--color-ink-high-hover);  --color-ink-pressed: oklch(81% .17 90);  --color-ink-highlight: transparent;  --color-ink-edge: var(--color-line-contour);  --color-thumb-on-high: oklch(15% 0 none);  --color-thumb-on-low: oklch(15% 0 none);   /* Depth: a hard shadow, offset */  --color-highlight: transparent;  --color-lip: transparent;  --color-shade-1: transparent;  --color-shade-2: transparent;  --color-shade-3: transparent;  --color-shade-4: transparent;  --color-shade-5: transparent;  --shadow-pressed: inset 0 0 0 2px var(--color-line-contour);  --shadow-flat: 0 0 0 2px var(--color-line-contour);  --shadow-raised: 0 0 0 2px var(--color-line-contour), 3px 3px 0 2px var(--color-line-contour);  --shadow-raised-hover: 0 0 0 2px var(--color-line-contour), 5px 5px 0 2px var(--color-line-contour);  --shadow-lifted: 0 0 0 2px var(--color-line-contour), 6px 6px 0 2px var(--color-line-contour);  --shadow-ink: var(--shadow-raised);  --shadow-ink-hover: var(--shadow-raised-hover);  --shadow-ink-pressed: var(--shadow-pressed);  --shadow-ink-well: inset 0 0 0 2px var(--color-line-contour);  --shadow-thumb-on-ink: 0 0 0 0 transparent;} /* Circles in place of squircles */:root {  --corner-shape: round;  --corner-scale: 1;}
  1. Utility

    One instance

    class="btn w-full"

    Everything follows upstream

  2. Token

    Every component that reads it

    --radius-control: .5rem

    Everything follows upstream

  3. Property

    One component’s size or spacing

    --btn-height: 2rem

    Everything follows upstream

  4. Theme

    The whole material

    @import './themes/app.css'

    Every component follows upstream

  5. Own

    Structure, parts, states and behavior

    npx master-ui own menu

    The other components follow upstream

HTML first

Markup in, material out.

A component is a class on a native element, so the same markup works in plain HTML, React, Svelte and Vue. There is no runtime to install and nothing to hydrate: the browser draws the material from one stylesheet, and every state from the element’s own attributes.

Framework components
deployments.html18 lines
<section class="card">
  <header class="card-header">
    <h3 class="card-title">Preview deployments</h3>
    <p class="card-description">A URL for every pull request.</p>
    <input type="checkbox" role="switch" class="switch card-action"
      checked aria-label="Preview deployments">
  </header>
  <div class="card-body">
    <label class="field">
      Branch pattern
      <input class="input" value="feature/*">
    </label>
  </div>
  <footer class="card-footer">
    <button type="button" class="btn btn-sm">Reset</button>
    <button type="button" class="btn btn-sm btn-primary">Save</button>
  </footer>
</section>

Drawn by the stylesheet alone

Preview deployments

A URL for every pull request.

Of 129 component stylesheets, 92 are markup in every framework and 37 have a framework component.
  1. accordion
  2. alert
  3. avatar, a framework component
  4. badge
  5. banner
  6. breadcrumb
  7. breakdown
  8. bullets
  9. busy
  10. button
  11. calendar, a framework component
  12. card
  13. caret
  14. carousel, a framework component
  15. category
  16. chart, a framework component
  17. checkbox
  18. checklist
  19. chip
  20. choice
  21. citation
  22. coachmark · tour, a framework component
  23. code
  24. color-picker, a framework component
  25. combobox, a framework component
  26. command, a framework component
  27. compare, a framework component
  28. composer
  29. countdown
  30. cropper, a framework component
  31. data-list
  32. device
  33. dial, a framework component
  34. dialog, a framework component
  35. divider
  36. dock
  37. dropzone
  38. editable, a framework component
  39. editor
  40. empty
  41. expand
  42. figure
  43. file
  44. flash
  45. gantt, a framework component
  46. gauge
  47. gradient, a framework component
  48. heading
  49. heatmap
  50. hotspot
  51. icon
  52. icon-frame
  53. input · field, a framework component
  54. kanban, a framework component
  55. kbd
  56. keypad
  57. lightbox
  58. link
  59. list
  60. listbox, a framework component
  61. mark
  62. marquee
  63. mention
  64. menu, a framework component
  65. message
  66. meter
  67. nav
  68. navbar
  69. odometer
  70. otp, a framework component
  71. pager
  72. pagination
  73. panel, a framework component
  74. pile
  75. player, a framework component
  76. poll
  77. popover, a framework component
  78. presence
  79. price
  80. progress
  81. quote
  82. radio
  83. range
  84. rating
  85. reaction
  86. reveal
  87. revision
  88. scale
  89. schedule, a framework component
  90. scroll-area · log, a framework component
  91. segmented
  92. select
  93. shimmer
  94. signature, a framework component
  95. skeleton
  96. skip
  97. slider
  98. snippet
  99. sortable, a framework component
  100. sparkline
  101. spinner
  102. splitter, a framework component
  103. stat
  104. stepper, a framework component
  105. steps
  106. surface
  107. swatch
  108. swipe
  109. switch
  110. tabbar
  111. table
  112. tabs, a framework component
  113. tags, a framework component
  114. texture
  115. thread
  116. ticket
  117. timeline
  118. toast, a framework component
  119. toc
  120. toolbar, a framework component
  121. tooltip, a framework component
  122. trace
  123. transcript, a framework component
  124. tree, a framework component
  125. uptime
  126. vote
  127. waveform
  128. wheel, a framework component
  129. window

A framework component exists when the framework owns one of these

  • A value the application reads or sets
  • Rows rendered from data
  • Ids that join parts
  • A lifetime

Cost

Ship only what the page uses.

Each component is its own stylesheet over one theme, and most need no script. Pick what your page uses; every size is measured at build time.

Compiled from @master/ui

The default selection, measured at build time
StylesheetScriptCompiled, kB
Themenone20.5
Cardnone6.0
Category with Inputnone5.8
Icon with Buttonnone0.3
Buttonnone11.5
Inputnone20.0
Selectnone8.2
Checkboxnone3.7
Switchnone3.3
Chip with Inputnone7.9
Tabstabs.js, optional3.0
Dialogdrawer.js, optional10.3
Tooltipnone3.0
Spinner with Buttonnone1.2
Avatar with Inputavatar.js, optional4.2
Badgenone6.7
Kbd with Inputnone0.9

A settings page

16 stylesheets

CSS, gzipped

18.0kB

21%

21% of the whole library, 87.2 kB gzipped

116.5 kB compiled: the theme once, then 16 stylesheets. 6 of them come with another component.

JavaScript, gzipped

0kB

0%

0% of every behavior, 94.9 kB gzipped

None required: every state is drawn from native elements and their attributes. What is marked optional is not counted.

  • drawer.jsoptional, for Dialog1.8 kB
  • tabs.jsoptional, for Tabs1.4 kB

How it is measured137 stylesheets · 55 behaviors · esbuild, gzip
  1. The theme counts once. Each stylesheet adds its own compiled rules, the kB listed beside it, and brings every stylesheet it composes: a dialog brings the button.
  2. CSS is compiled the way the package build writes dist/standalone.css, unminified, then gzipped as one file. Compressed sizes do not add up, so this page gzips each selection it cuts from the published file.
  3. The whole library is 596.0 kB compiled and 87.2 kB gzipped; minified by esbuild 0.28.1 and gzipped, 76.5 kB. The reset the components assume, base.css, adds 1.7 kB gzipped where a project has none.
  4. JavaScript is each behavior module minified by esbuild and gzipped as its own file; internal.js, which 19 behaviors share, counts once. 1 kB is 1,000 bytes.

Compared

The same components, weighed the same way.

Six common components, built for production with Master UI and shadcn/ui, measured by one script. All six on one page: 12.8 kB with Master UI, 149.2 kB with shadcn/ui on Base UI, gzipped. The gap is JavaScript.

Read the benchmark and run it
React and React DOM
shadcn/ui on
First load, gzipped: HTML, CSS and JavaScript of each page, in kB
ComponentFirst load, gzipped, kBTotalCSSJS
The setup aloneno component
Master UI: 2.9 kB, CSS 2.7, JS 0Master UI: 2.9 kB, CSS 2.7, JS 0
shadcn/ui, Base UI: 70.7 kB, CSS 2.4, JS 68.0shadcn/ui, Base UI: 3.2 kB, CSS 2.4, JS 0.5shadcn/ui, Radix: 70.7 kB, CSS 2.4, JS 68.0shadcn/ui, Radix: 3.2 kB, CSS 2.4, JS 0.5
Button
Master UI: 4.7 kB, CSS 4.5, JS 0Master UI: 4.7 kB, CSS 4.5, JS 0
shadcn/ui, Base UI: 87.5 kB, CSS 4.2, JS 83.0shadcn/ui, Base UI: 19.9 kB, CSS 4.2, JS 15.5shadcn/ui, Radix: 85.9 kB, CSS 4.2, JS 81.4shadcn/ui, Radix: 18.4 kB, CSS 4.2, JS 13.9
Card
Master UI: 5.5 kB, CSS 5.1, JS 0Master UI: 5.5 kB, CSS 5.1, JS 0
shadcn/ui, Base UI: 88.6 kB, CSS 4.9, JS 83.4shadcn/ui, Base UI: 21.1 kB, CSS 4.9, JS 15.9shadcn/ui, Radix: 87.1 kB, CSS 4.9, JS 81.9shadcn/ui, Radix: 19.5 kB, CSS 4.9, JS 14.4
Dialog
Master UI: 5.9 kB, CSS 5.4, JS 0Master UI: 5.9 kB, CSS 5.4, JS 0
shadcn/ui, Base UI: 108.4 kB, CSS 5.4, JS 102.7shadcn/ui, Base UI: 40.9 kB, CSS 5.4, JS 35.2shadcn/ui, Radix: 100.8 kB, CSS 5.4, JS 95.1shadcn/ui, Radix: 33.3 kB, CSS 5.4, JS 27.6
TabsMaster UI: tabs.js
Master UI: 6.0 kB, CSS 4.2, JS 1.2Master UI: 6.0 kB, CSS 4.2, JS 1.2
shadcn/ui, Base UI: 94.5 kB, CSS 4.1, JS 90.1shadcn/ui, Base UI: 27.0 kB, CSS 4.1, JS 22.5shadcn/ui, Radix: 93.3 kB, CSS 4.1, JS 88.9shadcn/ui, Radix: 25.8 kB, CSS 4.1, JS 21.4
SelectMaster UI: native, no script
Master UI: 8.3 kB, CSS 8.0, JS 0Master UI: 8.3 kB, CSS 8.0, JS 0
shadcn/ui, Base UI: 126.8 kB, CSS 4.8, JS 121.7shadcn/ui, Base UI: 59.3 kB, CSS 4.8, JS 54.2shadcn/ui, Radix: 116.0 kB, CSS 4.8, JS 110.9shadcn/ui, Radix: 48.5 kB, CSS 4.8, JS 43.4
Tooltip
Master UI: 5.2 kB, CSS 4.9, JS 0Master UI: 5.2 kB, CSS 4.9, JS 0
shadcn/ui, Base UI: 115.3 kB, CSS 5.1, JS 109.9shadcn/ui, Base UI: 47.8 kB, CSS 5.1, JS 42.4shadcn/ui, Radix: 104.6 kB, CSS 4.9, JS 99.4shadcn/ui, Radix: 37.1 kB, CSS 4.9, JS 31.9
All six11.7× lighter with Master UI6.4× lighter with Master UI10.0× lighter with Master UI4.7× lighter with Master UI
Master UI: 12.8 kB, CSS 10.6, JS 1.2Master UI: 12.8 kB, CSS 10.6, JS 1.2
shadcn/ui, Base UI: 149.2 kB, CSS 7.8, JS 141.1shadcn/ui, Base UI: 81.7 kB, CSS 7.8, JS 73.6shadcn/ui, Radix: 127.6 kB, CSS 7.7, JS 119.5shadcn/ui, Radix: 60.0 kB, CSS 7.7, JS 52.0
How it was measured2026-11-12 · shadcn/ui 4.23.0 · Vite 8.3.8
  1. Every file the built page loads first, gzipped: the HTML, its stylesheets and its module scripts. Master UI writes the markup in the HTML; shadcn/ui renders it from JavaScript. React and React DOM are 67.5 kB of that JavaScript on every shadcn/ui page; “Without React” leaves them out. Lightning CSS minifies both builds’ CSS, so it weighs less here than in the unminified figures above.
  2. CSS alone, shadcn/ui ships less for Button, Card, Dialog, Tabs, Select, and all six, since Tailwind writes only the utilities a page uses. The widest gap is Select: 8.0 kB against 4.8 kB. A Master UI select compiles 7 stylesheets after the theme, itself and what it composes: icon, button, input, select, chip, spinner, and kbd.
  3. Master UI needs a script only where no native element does the job. Tabs that switch panels in place load the tabs behavior; the select measured is a native select, which needs none. Drawn as a combobox, a select costs 8.2 kB of CSS and 1.8 kB of JavaScript.
  4. shadcn/ui 4.23.0 (base-nova, radix-nova) on Vite 8.3.8, React 19.3.1, Tailwind CSS 4.3.5; Master UI from commit e531b7e on the same Vite. Built with Vite’s defaults, gzipped by node:zlib, on 2026-11-12 (Apple M5 Max, Node v26.13.0); 1 kB is 1,000 bytes. benchmarks/shadcn-cost

Contracts

Written for people, checked for agents.

Every component ships a contract: its classes, states and keys, when to use it, and one correct example. Agents read it before they write; the checker flags markup that breaks it.

@master/ui/components/switch.jsonChecked by @master/ui/check when this page was built

switch.jsoncomponent · Forms · script: none

Switch

A pearl thumb that slides onto ink for settings that apply at once.

Use it for

A setting that is on or off and takes effect immediately, without a save button.

Classes

switch
root
<input type="checkbox" role="switch">label
switch-sm
modifier
of switchexclusive: size
switch-lg
modifier
of switchexclusive: size

States

on
switch
:checked
disabled
switch
disabled

A state is marked with an attribute or a pseudo-class, never with a class.

Keyboard

Space
Toggles the switch, as the native checkbox does

Example

Also in the file: instead · composes

settings.htmlFirst draft

<label class="check">  <input type="checkbox" class="switch switch-on" checked>  Email notifications</label>

Terminalexit 1

npx master-ui check settings.htmlsettings.html:2:3 error attribute "switch" needs role="switch" on its element.settings.html:2:3 warning unknown-class "switch-on" is not a class of switch. It has: switch, switch-sm, switch-lg.1 files checked: 1 errors, 1 warnings.

Line 2, rewritten from the example

Before: <input type="checkbox" class="switch switch-on" checked>After: <input type="checkbox" role="switch" class="switch" checked>

Terminalexit 0

npx master-ui check settings.html1 files checked: 0 errors, 0 warnings.

What the site publishes for programs

Library

From a button to a whole page.

Components with live previews, their markup and the contract a coding agent reads. Charts that draw data in more than twenty forms. Blocks that put them together into the parts of a product. Pages that frame a whole screen. Copy any of them and keep it.

Components 136

Browse components

Charts 21

Browse charts

Blocks 30

Browse blocks

Pages 11

Browse pages

Copy the markup. Keep your stack.

Install the package, import its stylesheet and write a class on a native element. Every component works in plain HTML and in any framework.

Get started