Skip to content

No.99 · Controls

Preset Keys

The station buttons on an old radio, as a radio group: press one and it latches down with a solid clack, the one that was down springs back up, and the needle sweeps across the lit dial to the station — the glow dimming while it travels and coming up warm once it's tuned.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Walnut

Build a radiogroup styled as a vintage radio's latching preset keys. Cabinet: a themed frame with a speaker grille (dot pattern), a dial behind glass, a lit display window and a well of keys. Dial: an FM scale 88–108 with half-MHz ticks, major ticks and numbers every 2MHz, small station marks with names, and a red needle positioned by the selected frequency; the needle slides with a 760ms ease that overshoots slightly (cubic-bezier(.45,0,.2,1.18)). A warm radial glow lights the scale from below; while the needle travels it dims to 35% (fast) and comes back (500ms) once tuned. Glass reflection over the top. The window shows the station name (or "· · ·" while tuning, aria-live polite) and the frequency in glowing mono digits. Keys: real buttons, role="radio" with aria-checked, roving tabindex, arrows/Home/End select and focus. Each cap has a front face, a 10px depth edge and a cast shadow; the checked key is latched down (translateY 8px, depth and shadow collapse, slightly darker, number turns red) and pressing goes down fast (90ms ease-in); a key released by another springs back up with overshoot (340ms cubic-bezier(.3,1.7,.5,1)). Reduced motion: no transitions. Selected variant — Walnut (walnut): theme="walnut": a walnut frame (layered fine stripes over a warm gradient), ivory key caps and an amber display window, on #e6dccb; five Muscat stations, Hala FM 102.7 selected. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Click a key, or Tab to the group and use the arrow keys. Motion: Latch 90ms down, 340ms spring up; needle 760ms with a slight overshoot; glow dims while tuning. Accessibility: A labelled radiogroup with radio buttons, roving focus and arrow keys; station changes are announced politely in the display window. Responsive behavior: The cabinet is at most 560px wide and the keys share the width evenly down to phone sizes. Touch: Tap a key; the pressed state shows under the finger. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Click a key, or Tab to the group and use the arrow keys.
Motion
Latch 90ms down, 340ms spring up; needle 760ms with a slight overshoot; glow dims while tuning.
Accessibility
A labelled radiogroup with radio buttons, roving focus and arrow keys; station changes are announced politely in the display window.
Responsive
The cabinet is at most 560px wide and the keys share the width evenly down to phone sizes.
On touch
Tap a key; the pressed state shows under the finger.