No.156 · 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
The design brief behind this component — reuse it to regenerate, remix, or explain it.
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.
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.