Agent PickerPRO
Choose an assistant or persona from cards with a gliding highlight, or from a compact dropdown.
Code
2 files · 556 lines of TypeScriptPRO
Agent Picker is part of Pro
Get its source, the one-paste agent prompt and all 113 components, for a one-time $99.
Motion notes
- The selected card's fill is one shared layout element, so it glides between cards on the layout spring instead of fading out here and in there.
- The chosen agent's avatar smiles, its radio mark pops and draws a check, and its capability chips ripple up one stagger step apart, so selection lands as a small moment.
- The dropdown reuses the same idea: a hover highlight slides between options, the trigger's avatar and name swap vertically, and the avatar looks around while the list is open.
- Cards follow the radiogroup pattern (arrows move by column and row, Home/End jump); the dropdown is a listbox with active-descendant keys, Escape and outside-press to close. With reduced motion, highlights snap and entrances are skipped.
Usage
Example
<AgentPicker
agents={[
{ id: "atlas", name: "Atlas", skill: "Everyday questions", capabilities: ["Chat", "Web"] },
{ id: "forge", name: "Forge", skill: "Writes and runs code", capabilities: ["Code", "Files"] },
]}
value={agentId}
onValueChange={setAgentId}
/>
<AgentPicker variant="dropdown" agents={agents} value={agentId} onValueChange={setAgentId} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| agents | { id, name, skill, capabilities?, avatar? }[] | — | Agents to choose from. avatar replaces the default animated Agent Avatar. |
| value | string | — | Controlled selected agent id. |
| defaultValue | string | — | Initial selection when uncontrolled. Defaults to the first agent. |
| onValueChange | (id: string) => void | — | Called when the selection changes. |
| variant | "cards" | "dropdown" | "cards" | Cards for a picker screen, or a compact dropdown for a toolbar. |
| columns | 1 | 2 | 2 | Card columns. |
| label | string | "Assistant" | Accessible name for the group or listbox. |
| open | boolean | — | Dropdown only: controlled open state. |
| defaultOpen | boolean | false | Dropdown only: initial open state. |
| onOpenChange | (open: boolean) => void | — | Dropdown only: called when the list opens or closes. |
| activeId | string | — | Dropdown only: controlled highlighted option. |
| onActiveIdChange | (id: string) => void | — | Dropdown only: called as the highlight moves. |
| className | string | — | Classes for the grid or the dropdown wrapper. |