Transfer

Forms
Selection

Dual-list selector for moving items between lists with search, select all, and bidirectional transfer support.

Preview

Simple dual-list transfer with search functionality

Available Items
8 items
Selected Items
0 items
No items

With Initial Selection

Transfer component with pre-selected items

Source
6 items
Target
2 items

Without Search

Disable search functionality for simple transfers

All Team Members
6 items
Project Team
0 items
No items

One-way Transfer

Only allow moving items from source to target

Available Skills
5 items
Required Skills
0 items
No items

Custom List Height

Adjust list height for different content amounts

Source
8 items
Target
0 items
No items

Props

Transfer component API reference

PropTypeDefaultDescription
dataSourceTransferItem[]All available items
targetKeysstring[]Keys of selected items
onChange(keys: string[]) => voidCallback when selection changes
titles[string, string]['Source', 'Target']List titles
searchablebooleantrueEnable search
oneWaybooleanfalseOne-way transfer only
listHeightnumber300List height in pixels
showSelectAllbooleantrueShow select all checkbox

TransferItem Type

interface TransferItem {
  key: string        // Unique identifier
  title: string      // Item display text
  description?: string  // Optional description
  disabled?: boolean // Disable item selection
}

Usage

Import and implementation example

import { Transfer, TransferItem } from '@/components/ui/transfer'

export default function Example() {
  const [targetKeys, setTargetKeys] = useState<string[]>([])

  const data: TransferItem[] = [
    { key: '1', title: 'Item 1', description: 'Description' },
    { key: '2', title: 'Item 2' },
    { key: '3', title: 'Disabled Item', disabled: true },
  ]

  return (
    <>
      {/* Basic usage */}
      <Transfer
        dataSource={data}
        targetKeys={targetKeys}
        onChange={setTargetKeys}
        titles={['Available', 'Selected']}
      />

      {/* Without search */}
      <Transfer
        dataSource={data}
        targetKeys={targetKeys}
        onChange={setTargetKeys}
        searchable={false}
      />

      {/* One-way transfer */}
      <Transfer
        dataSource={data}
        targetKeys={targetKeys}
        onChange={setTargetKeys}
        oneWay={true}
      />

      {/* Custom height */}
      <Transfer
        dataSource={data}
        targetKeys={targetKeys}
        onChange={setTargetKeys}
        listHeight={200}
      />
    </>
  )
}

Features

Built-in functionality

  • Dual-list interface: Source and target lists side by side
  • Search filtering: Filter items by title
  • Select all: Bulk select all visible items
  • Bidirectional transfer: Move items in both directions
  • One-way mode: Restrict to source-to-target only
  • Disabled items: Prevent specific items from being moved
  • Custom titles: Label each list appropriately
  • Dark mode: Full dark mode support

Accessibility

Accessibility considerations

ARIA Attributes

Lists use proper role="listbox"Items use role="option"Selected state communicated via aria-selected

Keyboard Navigation

KeyAction
TabNavigate between controls
SpaceSelect/deselect item
EnterTrigger transfer buttons
Arrow KeysNavigate items in list

Notes

  • Transfer buttons indicate direction
  • Search input is properly labeled
  • Selection count shown in header
  • Disabled items are skipped in navigation