Off The Ball
Articles · Matches · Career · About
Button group / headless button
Put HeadlessButton inside a ButtonGroup and it picks up the pill shape and the active colour automatically. Outside a group only the text is left.
Selection events show up here.
Button / HeadlessButton extension
Button is the design layer: it wraps HeadlessButton and adds the pill background, state layers and icon placement. You pick one variant for the shape, and every colour and measurement comes from tokens (--md-comp-button-*). Icons go in front via icon and behind via trailingIcon.
Switch / football thumb
Variants that only swap the thumb slot of Switch. The header logo is this component in its off state.
Switch events show up here.
Sheet · popup
There is one Sheet and the viewport width picks its shape — narrow: a bottom sheet you push down to dismiss; wide: a centred card with a close button top right. The header is gradient-blur glass, so scrolling the body under it fades and shows through, and the sheet has no bottom button area (it only handles closing). Popup is a short confirmation dialog that always opens in the middle regardless of width, and both route via ?sheet=<id> / ?popup=<id>, so back is close and opening the URL directly opens them.
Popup button callbacks show up here.
Text input
Input is one form field — label, surface, rule, control and helper rendered together. The field sits on the text baseline (--md-comp-input-*): a single tint of on-surface (6%) closed underneath by one underline — no glass, no blur, no shadow, no hairline. button gives the same field a <button> — which is exactly how DateSelector’s field below is built. helper adds one line of guidance, error moves that same line into the error colour (only the rule and the indicator change colour), and focusing fades an indicator in over the rule. Fields with and without a helper line up on their label row. The affixes in front of and behind the value, and the actions at its end (stepper, clear, reveal), are in the Input variants card below.
At least two characters
Formation is required
Typed values show up here.
Input variants
Views are the same field with pieces added. prefix and unit mute beside the value in the label colour, and screen readers get them through aria-describedby only. inputmode follows type (number → numeric · tel → tel · url → url). Numeric fields pull the value to the inline end so it reads as one lump with its unit (182 cm), and stepper (− / +) moves by step without leaving min / max. clearable shows a × while there is a value, reveal shows and hides a password, multiline puts a <textarea> in the same field and counter counts characters at the right end of the helper line. All three fix the value and fire a native input, so the status line below keeps following. readonly keeps the underline and only blocks typing — unlike disabled, its value still ships with the form.
Only typing is blocked — the text is still selectable
Up to 140 characters0/140
Typed values show up here.
Date picker
DateSelector builds its field on Input in button mode and opens a calendar panel right where that field is — a <dialog> placed the way Menu is (measured against the trigger, flipped when it would leave the viewport). The underlined field and its focus indicator belong to Input; this component owns only the panel. The value travels as yyyy-mm-dd on date:change, and with name a hidden input carries it into forms. Days outside min / max are inert and the month arrows stop at months with no selectable day. Keyboard: ← → ↑ ↓ · Home/End · PageUp/PageDown (Shift for years).
Date events show up here.