Skip to content

No.242 · AI & Chat

Model Picker

A model switcher that tells you what you're trading: each model shows two quiet meters — speed and depth — and the selection mark slides between rows while the trigger's label rolls over.

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: Paper

Build a model switcher for an AI chat. The trigger is a hairline pill with the current model name and a chevron; when the model changes, the name rolls vertically in the direction you moved through the list (420ms expo-out). The popover (16px radius, surface, soft deep shadow, opens from 0.97 scale) holds a listbox. Every option has a name (with an optional mono badge like DEFAULT or BETA), a one-line note, and two identical 5-pip meters — SPEED and DEPTH — so the list reads as a trade-off rather than a list of names; the selected row's pips turn accent and its tick draws in. A single selection mark (tinted pill with an inset accent ring) glides between rows by animating top and height (380ms), instead of rows flashing. Hover and ↑/↓/Home/End move the active option; Enter/Space choose it, then the popover closes and focus returns to the trigger. Esc/Tab/outside click close. Ship paper and night themes. Selected variant — Paper (paper): Apply the paper theme. Where the brief above gives no colour values for it, choose a restrained paper palette with text at 4.5:1 contrast or better. Keep the geometry, states and motion described above unchanged. 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 (or ↑/↓ on the trigger) to open; hover or arrow through the models; Enter or click to choose. Motion: Popover opens 320ms from 0.97; selection mark glides 380ms; tick draws 360ms; trigger label rolls 420ms in the direction of travel. Accessibility: Button with aria-haspopup='listbox' and aria-expanded; the listbox uses aria-activedescendant; meters have hidden text ('Speed 4 of 5, depth 4 of 5'); focus returns to the trigger. Reduced motion removes the roll and glide. Responsive behavior: The popover is min(21rem, 100vw − 2rem) wide. Touch: Tap to open and tap a model; rows are 60px+ tall. 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 (or ↑/↓ on the trigger) to open; hover or arrow through the models; Enter or click to choose.
Motion
Popover opens 320ms from 0.97; selection mark glides 380ms; tick draws 360ms; trigger label rolls 420ms in the direction of travel.
Accessibility
Button with aria-haspopup='listbox' and aria-expanded; the listbox uses aria-activedescendant; meters have hidden text ('Speed 4 of 5, depth 4 of 5'); focus returns to the trigger. Reduced motion removes the roll and glide.
Responsive
The popover is min(21rem, 100vw − 2rem) wide.
On touch
Tap to open and tap a model; rows are 60px+ tall.