Assign Picker, animated React component
- Pro
- Inputs & Controls
- Spring
An assignee pill with a multi-select menu. Tick people and each avatar flies from its row into the pill, which grows to hold them and stacks them with a count past three; the label reads one name, two names or a number.
Pops when you tick a person and ticks when you untick them. Sound is off on this site until you switch it on.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| people | AssignPerson[] | five sample people | People in the menu: { id, name, role, colors: [from, to] }. Avatars are gradient circles with initials. |
| defaultValue | string[] | [] | Ids selected on first render. |
| onChange | (ids: string[]) => void | undefined | Called with the selected ids, in the order they were picked. |
| autoplay | boolean | false | Opens the menu, ticks four people, closes and clears, on a loop until the user clicks. |
| multiple | boolean | true | Lets several people be ticked. Turn it off and each pick replaces the last and closes the menu. |
| maxFaces | number | 3 | How many faces the pill shows before the rest collapse into a +N count. Clamped to 1 to 5. |
| faceSize | number | 28 | Diameter in px of the faces in the pill. Clamped to 22 to 36. |
| bounce | number | 1 | How much the faces overshoot as they land in the pill. Higher bounces more, lower settles flat. Clamped to 0.5 to 2. |
| enableSound | boolean | true | Plays interface sounds on interaction. They follow the sound switch (setSoundsEnabled, on by default) and stay silent on hover. Autoplay makes the same sounds once the visitor has used the page. Pass false to silence this component. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry with your API key
Assign Picker is a Pro item, so the CLI has to send your API key. Do this once per project:
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
nxs_and is shown only once. - In your project root, next to
package.json, create a file named.env.localwith this line, using your own key:NEXUS_API_KEY=nxs_your_key_here
- Open
components.jsonand add this entry inside the outermost braces, next to"aliases". Leave{name}and${NEXUS_API_KEY}exactly as written; the CLI fills them in:"registries": { "@nexus-labs": { "url": "https://www.nexus-ui.com/api/registry/{name}", "headers": { "Authorization": "Bearer ${NEXUS_API_KEY}" } } }
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
Assign Picker questions
How do I install Assign Picker?
Run `npx shadcn@latest add @nexus-labs/assign-picker`. It installs framer-motion. Assign Picker is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).
How do I pass in people?
Pass `people` as `{ id, name, role, colors }`, where `colors` is two colors for the avatar gradient. Avatars are gradient circles with initials drawn on top, so no images are loaded. Without `people` it shows five sample people.
How do I read or preselect the selection?
`onChange` receives the selected ids in the order they were picked, and `defaultValue` sets the ids selected on first render. There is no controlled `value` prop, so the component holds the selection itself.
What does the pill label say?
It reads "Assign" when empty, the first name for one person, "Ana and Ben" style first names for two, and "N people" for three or more. Up to three avatars stack in the pill, with a +N chip beyond that.
Is the menu keyboard and screen reader friendly?
The pill is a button with `aria-haspopup="listbox"` and `aria-expanded`. The menu is a multiselectable listbox whose options carry `aria-selected`. Escape closes the menu and returns focus to the pill.
Does it make sound, and how do I turn it off?
Pops when you tick a person and ticks when you untick them. Sounds are synthesised with the Web Audio API, so there are no audio files, and they only play after a click or key press. Pass `enableSound={false}` to silence this component, or call `setSoundsEnabled(false)` from `@/lib/ui-sounds` to switch every sound off at once. The CLI installs `@/lib/ui-sounds` with the component.

