Inputs
Generated from DESIGN_SYSTEM.md
Rules
A checkbox marks an item as selected (in a set, in a form to be submitted); a switch flips a state that takes effect immediately โ auto-reply on, a connector enabled, a consent granted. HIG and Material draw the same line.
| Platform | Component |
|---|---|
| Web | <Switch> from @yroun/ui (checked / onCheckedChange / disabled / label or ariaLabel) โ brand fill on, zinc track off, white thumb, role="switch" + aria-checked |
| iOS | SwiftUI Toggle with .tint(AppTheme.Colors.brandPrimary) |
| Android | Material 3 Switch, colorScheme.primary |
- One switch, no size or color variants โ variants are how the fragmentation this ended starts over.
labelrenders the visible text as part of the same control (clicking it toggles); passariaLabelonly when no visible label sits with it.- Review heuristic: a new
type="checkbox"whose handler mutates server state immediately (not on form submit) is a switch wearing the wrong control โ rejected.
Pills โ four roles, one discipline
Rounded tinted surfaces serve FOUR distinct roles. Every pill on any surface must be one of these, via its named utility โ never a hand-rolled variant:
| Role | Utility (web) | Differentiator | Interactive? |
|---|---|---|---|
| Action | btn btn-filled / btn btn-tinted + a size (see Buttons) | 44pt min height on touch, size from btn-sm/md/lg | โ tap = do something |
| Filter chip | chip-filter (+ chip-filter-active) | min-h-9, text-xs, bordered | โ tap = narrow a list |
| Option card | option-card (+ option-card-active) | full-width rounded-2xl tile, title + description | โ tap = pick one of N |
| Status badge | badge-blue / badge-neutral / badge-featured | tiny (text-[11px]), no hover, no min-height | โ read-only label |
Rule 1 โ utilities are complete by default. Every utility above renders correctly bare. Active/selected variants carry the FULL base shape so both standalone and composed usage render identically. Call-site utilities still override the baked defaults when a context truly differs.
Rule 2 โ one state, one signal. A state already carried by an icon/shape (a check circle, a filled dot) does NOT also get a badge. Duplicated signals read as clutter and make the static badge look like a stray button.
Rule 3 โ status is never dressed as an action. Size is the separator: badges stay tiny with no hover/press states; anything 44pt-tall and tinted reads as tappable and must actually be tappable.
Live specimens
chip-filter ยท chip-filter-activebadge-blue ยท badge-neutralstatus-pill-ok ยท -warn ยท -dangeroption-card ยท option-card-active