Back to elements
ElementData DisplayFree

Transfer List React component

Two lists side by side for moving items from one set to another, such as available and granted permissions: tick items and send them across with the arrows (or double-click one), move everything at once, search each side, and watch rows glide between the lists.

When to use the Transfer List component

Use Transfer List when people build one set out of a larger pool and need to see both at once: permissions for a role, columns shown in a table, members of a group, fields in an export.

For picking a few options from a short list, a Multi Select or Checkbox Group takes less space.

Installation

Add the Transfer List component to your project with the shadcn CLI. It lands in components/transfer-list.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add https://reactframe.com/r/transfer-list.json

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

Props

<TransferList /> accepts 9 props, all optional.

  • items
    { id: string; label: string; description?: string; disabled?: boolean }[]
    Default: DEFAULT_ITEMS
  • value

    Ids in the right-hand (chosen) list.

    string[]
  • defaultValue
    string[]
    Default: ["read", "comment"]
  • onValueChange
    (ids: string[]) => void
  • titles
    [string, string]
    Default: ["Available", "Granted"]
  • searchable
    boolean
    Default: true
  • height

    Height of each list, in px.

    number
    Default: 300
  • theme
    "dark" | "light"
    Default: "dark"
  • className
    string

FAQ

How do items move between the lists?
Tick them and press an arrow, press a double arrow to move everything, or double-click a single row. The rows glide into the other list.
Can some items stay put?
Yes. Mark them disabled; they stay visible but can't be ticked or moved, which suits permissions that are always on or never allowed.
Does search affect moving everything?
Move all only moves the rows that match the current search, so you can filter first and then move the whole filtered set.

More Data Display components

Tree Table
Free
Organization Chart
Free
Chat Bubble
Free
Sortable List
Free
List Group
Free
Data View
Free