Transfer list

Assigns options between available and selected lists using native checkboxes and explicit move actions.

Assign cities
Available
Selected

No options

Choose the coverage

Assigned areas

Mark places, then move them between the available and selected lists.

Coverage areas
Available (3)
Selected (1)

1 selected

Use it for

  • Assigning a visible subset from a manageable option list.
  • Work where available and assigned options should stay visible together.

Not for

  • Very large lists; use searchable MultiSelect.
  • Ordering selected records; use SortableList.

Three ways in. They share one source, so the pixels match whichever you pick.

1. Import the package

npm install @noorddev/vlak-react

// once, next to your app's root
import "@noorddev/vlak-react/css";

import { TransferList } from "@noorddev/vlak-react";

Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/transfer-list.

2. Vendor the source

npx @noorddev/vlak-cli add transfer-list

The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.

3. Through shadcn

npx shadcn add https://vlak.dev/r/transfer-list.json

The same registry item, installed by shadcn's CLI.

CSS only

<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />

No React. Link vlak.css and use the markup and classes below.

import { TransferList } from "@noorddev/vlak-react";

<TransferList label="Coverage areas" name="areas" options={[{ value: "alkmaar", label: "Alkmaar" }, { value: "bergen", label: "Bergen" }, { value: "castricum", label: "Castricum" }]} defaultValue={["alkmaar"]} />

TransferList

PropTypeDefaultDescription
optionsrequiredTransferListOption[]
valuestring[]
defaultValuestring[][]
onValueChange(value: string[]) => void
labelReactNode"Assign options"
availableLabelstring"Available"
selectedLabelstring"Selected"
addLabelstring"Add selected"
removeLabelstring"Remove selected"
emptyLabelstring"No options"

Also accepts Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "onChange" | "defaultValue">.

KeysDoes
Tab, SpaceMoves through and marks native checkbox options.
Enter, Space on a move actionAdds or removes the marked options; marked state clears after the move.
<fieldset class="rs-transfer-list"><legend class="rs-transfer-list-legend">Assign cities</legend><div class="rs-transfer-list-columns"><fieldset class="rs-transfer-list-panel"><legend class="rs-transfer-list-heading">Available</legend><label class="rs-transfer-list-item"><input type="checkbox" /> Alkmaar</label></fieldset><div class="rs-transfer-list-actions"><button class="rs-btn-ghost" type="button">Add selected</button><button class="rs-btn-ghost" type="button">Remove selected</button></div><fieldset class="rs-transfer-list-panel"><legend class="rs-transfer-list-heading">Selected</legend><p class="rs-transfer-list-empty">No options</p></fieldset></div></fieldset>
.rs-transfer-list.rs-transfer-list-legend.rs-transfer-list-columns.rs-transfer-list-panel.rs-transfer-list-heading.rs-transfer-list-options.rs-transfer-list-item.rs-transfer-list-actions.rs-transfer-list-action.rs-transfer-list-empty.rs-transfer-list-status