Harbor
harbor.dev · 2 hours ago
ReadyNative elements and modern CSS do the work: dialogs, menus, tooltips and selects open, anchor and animate with zero JavaScript to start.
Platform
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 supportA 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
a1f9e2cReady7c04b1dReadye55d0a8BuildingPublish 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
It opens beside the button, turns back at the viewport edge and closes on Escape or a click outside.
popover position-area
Each tool names itself and its key on hover or keyboard focus, and stays out of the way of the click.
popover="hint" interestfor
1.28M this week · up 12.4%
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
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
The focus ring is cut by the mask on the code panel. Should it move to the group?
Yes. The group already has the corner, so the ring follows it.
The composer starts at one line and grows to ten as you type, then scrolls; the thread above stays put.
field-sizing: content
Rows sharing a name close each other, and each panel eases to its height with interpolate-size.
::details-content interpolate-size details[name]
A scroll-driven animation reads where the thumb is and fills the track up to it.
view-timeline timeline-scope
Customize
Colors, corners and shadows come from the theme’s tokens: retune the library instead of overriding it.
Choose a customizationLake Ilse loop
6.2 km · 2 h 10 min
Boathouse
Start · 0.0 km
Larch ridge
2.6 km
Summit
4.1 km
Lake Ilse loop
6.2 km · 2 h 10 min
Boathouse
Start · 0.0 km
Larch ridge
2.6 km
Summit
4.1 km
Lake Ilse loop
6.2 km · 2 h 10 min
Boathouse
Start · 0.0 km
Larch ridge
2.6 km
Summit
4.1 km
Lake Ilse loop
6.2 km · 2 h 10 min
Boathouse
Start · 0.0 km
Larch ridge
2.6 km
Summit
4.1 km
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;}One instance
class="btn w-full"Everything follows upstream
Every component that reads it
--radius-control: .5remEverything follows upstream
One component’s size or spacing
--btn-height: 2remEverything follows upstream
The whole material
@import './themes/app.css'Every component follows upstream
Structure, parts, states and behavior
npx master-ui own menuThe other components follow upstream
HTML first
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<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>export function PreviewDeployments() {
return (
<section className="card">
<header className="card-header">
<h3 className="card-title">Preview deployments</h3>
<p className="card-description">A URL for every pull request.</p>
<input type="checkbox" role="switch" className="switch card-action"
defaultChecked aria-label="Preview deployments" />
</header>
<div className="card-body">
<label className="field">
Branch pattern
<input className="input" defaultValue="feature/*" />
</label>
</div>
<footer className="card-footer">
<button type="button" className="btn btn-sm">Reset</button>
<button type="button" className="btn btn-sm btn-primary">Save</button>
</footer>
</section>
)
}<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><template>
<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>
</template>Drawn by the stylesheet alone
A URL for every pull request.
<div class="toast-region" role="region"
aria-label="Notifications" aria-live="polite">
<dialog open class="toast toast-success" aria-labelledby="forge-toast">
<svg class="icon toast-icon" viewBox="0 0 16 16" aria-hidden="true"
fill="none" stroke="currentColor" stroke-linecap="round">
<circle cx="8" cy="8" r="6"/>
<path d="M5 8L7.1041 9.8703A0.2 0.2 0 0 0 7.3832
9.8573L10.75 6.25"/>
</svg>
<div class="toast-body">
<p class="toast-title" id="forge-toast">Deployed to production</p>
<p class="toast-description">atlas.dev is live in 14 regions.</p>
</div>
<form method="dialog" class="toast-close">
<button class="btn btn-quiet btn-square btn-sm" aria-label="Dismiss">
<svg class="icon" viewBox="0 0 16 16" aria-hidden="true"
fill="none" stroke="currentColor" stroke-linecap="round">
<path d="M4 4L12 12"/>
<path d="M4 12L12 4"/>
</svg>
</button>
</form>
</dialog>
</div>export function DeployedToast() {
return (
<div className="toast-region" role="region"
aria-label="Notifications" aria-live="polite">
<dialog open className="toast toast-success" aria-labelledby="forge-toast">
<svg className="icon toast-icon" viewBox="0 0 16 16" aria-hidden="true"
fill="none" stroke="currentColor" strokeLinecap="round">
<circle cx="8" cy="8" r="6"/>
<path d="M5 8L7.1041 9.8703A0.2 0.2 0 0 0 7.3832
9.8573L10.75 6.25"/>
</svg>
<div className="toast-body">
<p className="toast-title" id="forge-toast">Deployed to production</p>
<p className="toast-description">atlas.dev is live in 14 regions.</p>
</div>
<form method="dialog" className="toast-close">
<button className="btn btn-quiet btn-square btn-sm" aria-label="Dismiss">
<svg className="icon" viewBox="0 0 16 16" aria-hidden="true"
fill="none" stroke="currentColor" strokeLinecap="round">
<path d="M4 4L12 12"/>
<path d="M4 12L12 4"/>
</svg>
</button>
</form>
</dialog>
</div>
)
}<div class="toast-region" role="region"
aria-label="Notifications" aria-live="polite">
<dialog open class="toast toast-success" aria-labelledby="forge-toast">
<svg class="icon toast-icon" viewBox="0 0 16 16" aria-hidden="true"
fill="none" stroke="currentColor" stroke-linecap="round">
<circle cx="8" cy="8" r="6"/>
<path d="M5 8L7.1041 9.8703A0.2 0.2 0 0 0 7.3832
9.8573L10.75 6.25"/>
</svg>
<div class="toast-body">
<p class="toast-title" id="forge-toast">Deployed to production</p>
<p class="toast-description">atlas.dev is live in 14 regions.</p>
</div>
<form method="dialog" class="toast-close">
<button class="btn btn-quiet btn-square btn-sm" aria-label="Dismiss">
<svg class="icon" viewBox="0 0 16 16" aria-hidden="true"
fill="none" stroke="currentColor" stroke-linecap="round">
<path d="M4 4L12 12"/>
<path d="M4 12L12 4"/>
</svg>
</button>
</form>
</dialog>
</div><template>
<div class="toast-region" role="region"
aria-label="Notifications" aria-live="polite">
<dialog open class="toast toast-success" aria-labelledby="forge-toast">
<svg class="icon toast-icon" viewBox="0 0 16 16" aria-hidden="true"
fill="none" stroke="currentColor" stroke-linecap="round">
<circle cx="8" cy="8" r="6"/>
<path d="M5 8L7.1041 9.8703A0.2 0.2 0 0 0 7.3832
9.8573L10.75 6.25"/>
</svg>
<div class="toast-body">
<p class="toast-title" id="forge-toast">Deployed to production</p>
<p class="toast-description">atlas.dev is live in 14 regions.</p>
</div>
<form method="dialog" class="toast-close">
<button class="btn btn-quiet btn-square btn-sm" aria-label="Dismiss">
<svg class="icon" viewBox="0 0 16 16" aria-hidden="true"
fill="none" stroke="currentColor" stroke-linecap="round">
<path d="M4 4L12 12"/>
<path d="M4 12L12 4"/>
</svg>
</button>
</form>
</dialog>
</div>
</template>Drawn by the stylesheet alone
<div class="segmented" role="radiogroup" aria-label="View">
<label class="segmented-item">
<input type="radio" class="segmented-input"
name="forge-view" value="list" checked>
List
</label>
<label class="segmented-item">
<input type="radio" class="segmented-input"
name="forge-view" value="board">
Board
</label>
<label class="segmented-item">
<input type="radio" class="segmented-input"
name="forge-view" value="timeline">
Timeline
</label>
</div>export function ViewSwitch() {
return (
<div className="segmented" role="radiogroup" aria-label="View">
<label className="segmented-item">
<input type="radio" className="segmented-input"
name="forge-view" value="list" defaultChecked />
List
</label>
<label className="segmented-item">
<input type="radio" className="segmented-input"
name="forge-view" value="board" />
Board
</label>
<label className="segmented-item">
<input type="radio" className="segmented-input"
name="forge-view" value="timeline" />
Timeline
</label>
</div>
)
}<div class="segmented" role="radiogroup" aria-label="View">
<label class="segmented-item">
<input type="radio" class="segmented-input"
name="forge-view" value="list" checked>
List
</label>
<label class="segmented-item">
<input type="radio" class="segmented-input"
name="forge-view" value="board">
Board
</label>
<label class="segmented-item">
<input type="radio" class="segmented-input"
name="forge-view" value="timeline">
Timeline
</label>
</div><template>
<div class="segmented" role="radiogroup" aria-label="View">
<label class="segmented-item">
<input type="radio" class="segmented-input"
name="forge-view" value="list" checked>
List
</label>
<label class="segmented-item">
<input type="radio" class="segmented-input"
name="forge-view" value="board">
Board
</label>
<label class="segmented-item">
<input type="radio" class="segmented-input"
name="forge-view" value="timeline">
Timeline
</label>
</div>
</template>Drawn by the stylesheet alone
A framework component exists when the framework owns one of these
Cost
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.
Nothing selected
Choose what the page uses from All.
Sizes in kB, compiledJS needs its scriptJS? script optional
| Stylesheet | Script | Compiled, kB |
|---|---|---|
| Theme | none | 20.5 |
| Card | none | 6.0 |
| Category with Input | none | 5.8 |
| Icon with Button | none | 0.3 |
| Button | none | 11.5 |
| Input | none | 20.0 |
| Select | none | 8.2 |
| Checkbox | none | 3.7 |
| Switch | none | 3.3 |
| Chip with Input | none | 7.9 |
| Tabs | tabs.js, optional | 3.0 |
| Dialog | drawer.js, optional | 10.3 |
| Tooltip | none | 3.0 |
| Spinner with Button | none | 1.2 |
| Avatar with Input | avatar.js, optional | 4.2 |
| Badge | none | 6.7 |
| Kbd with Input | none | 0.9 |
16 stylesheets
CSS, gzipped
18.0kB
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% 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 kBtabs.jsoptional, for Tabs1.4 kBdist/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.base.css, adds 1.7 kB gzipped where a project has none.internal.js, which 19 behaviors share, counts once. 1 kB is 1,000 bytes.Compared
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| Component | First load, gzipped, kBTotalCSSJS |
|---|---|
| The setup aloneno component | |
| Button | |
| Card | |
| Dialog | |
| TabsMaster UI: tabs.js | |
| SelectMaster UI: native, no script | |
| Tooltip | |
| All six11.7× lighter with Master UI6.4× lighter with Master UI10.0× lighter with Master UI4.7× lighter with Master UI |
Contracts
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/check when this page was builtA pearl thumb that slides onto ink for settings that apply at once.
A setting that is on or off and takes effect immediately, without a save button.
<input type="checkbox" role="switch">labelof switchexclusive: sizeof switchexclusive: size:checkeddisabledA state is marked with an attribute or a pseudo-class, never with a class.
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./llms.txtThe rules for writing Master UI markup, and a link to every page as Markdown.
/contracts.jsonEvery contract as data, for programs that write markup.
npx skills add master-co/ui --skill master-uiA skill that has an agent read the contracts, check its markup and verify the result in a browser.
npx master-ui add <name>React, Svelte and Vue components copied into the project as source, also served as a shadcn-style registry.
Library
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.
Install the package, import its stylesheet and write a class on a native element. Every component works in plain HTML and in any framework.