Transfer list
Two lists side by side with buttons between them: pick items on the left and move them to the right, such as the permissions a role grants. Each side searches, counts and selects all. For a short set of on and off choices, a checkbox group is lighter.
Install
npx shadcn@latest add @thrum-pro/transfer-listThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Automatically installs icons check, chevron-down, chevron-right, chevron-up and chevrons-right from the icon set.
Data shape
type TransferItem = { id: string; label: string; description?: string; disabled?: boolean };const permissions: TransferItem[] = [
{ id: "perm-0", label: "Read invoices" },
{ id: "perm-1", label: "Issue refunds", description: "Refund a paid invoice" },
];Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | TransferItem[] | Required | Every item, in the order the source list shows them. Ids are unique across both lists. |
value | string[] | – | The ids in the target list, in order, when the parent holds them. Use it with onValueChange. |
defaultValue | string[] | Default [] | The ids in the target list at first, when the component holds them itself. |
onValueChange | (ids: string[]) => void | – | Called with the target list's ids, in order, after every move or reorder. |
sourceLabel | string | Default "Available" | The source list's name. It heads the list and names it for screen readers. |
targetLabel | string | Default "Selected" | The target list's name. |
searchable | boolean | Default true | A search field over each list, matching the label and the description. |
reorderable | boolean | Default false | Move up and Move down buttons under the target list, and Alt with the arrow keys, for its order. |
emptyLabel | string | Default "No items" | Shown in a list with nothing in it. |
sound | boolean | Default true | Play a rising click when items join the target and a falling one when they leave it, if the visitor has sound on. |
className | string | – | Extra classes for the root, merged last. |
moveWithin() | function | – | More exports: the order after moving the selected ids one place up or down. |
Motion and sound
Motion
- Newly moved rows flash a subtle highlight ring that fades over 150 ms.
- Reduced motion: rows appear in the other list with no transition.
Sound
- A rising click when items join the target list and a falling one when they leave it.
- The select-all boxes click as checkboxes do.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- Each side is a listbox that takes several picks, named by its heading, with one tab stop and the focused item followed by aria-activedescendant.
- A selected item shows a tick as well as its shade, and the count reads 2 of 6 selected to screen readers.
- The move buttons are named for where they send items, such as Move selected to Granted, and turn off when there is nothing to move.
- Moved items stay selected in their new list, so a wrong move is one click back.
- A disabled item is shown at half strength, cannot be picked and is left out of Move all.
- Below 512 pixels wide the lists stack, and the arrows point down and up.
| Keys | Action |
|---|---|
| Tab | Move through each list's select-all box, search field and list, and the move buttons. |
| ↓ / ↑ / Home / End | In a list: move and select that item alone. |
| Shift + ↓ / ↑ | Extend the selection from the last picked item. |
| Ctrl + ↓ / ↑, then Space | Move without selecting, then add or remove the focused item. |
| Ctrl + A | Select every item in the list. |
| Enter | Move the focused item to the other list. A double-click does the same. |
| Alt + ↑ / ↓ | In the target list, when it can be reordered: move the selected items up or down. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/transfer-list.tsx- Packages
- None
- Brings along
- ButtonCheckboxSearch fieldSound engine
- Icons
checkchevron-downchevron-rightchevron-upchevrons-right
Changelog
- 1.0.0 · 2026-12-03First release.