Data Display

Transfer

Dual-list picker to move items between a source and target list, with search, select-all, and disabled item support.

Available0/8
  • Component 1
    UI component #1
  • Component 3
    UI component #3
  • Component 5
    UI component #5
  • Component 6
    UI component #6
  • Component 7
    UI component #7
  • Component 8
    UI component #8
  • Component 9
    UI component #9
  • Component 10
    UI component #10
Selected0/2
  • Component 2
    UI component #2
  • Component 4
    UI component #4

Installation

npx benflux-ui add transfer

Usage

import { Transfer, type TransferItem } from "@benflux-ui/react"

const items: TransferItem[] = [
  { key: "1", title: "Item 1", description: "First item" },
  { key: "2", title: "Item 2", disabled: true },
]

const [targetKeys, setTargetKeys] = useState<string[]>([])

<Transfer
  dataSource={items}
  targetKeys={targetKeys}
  onChange={setTargetKeys}
  titles={["Source", "Target"]}
  showSearch
  render={(item) => item.title}
/>

Props

PropTypeDefaultDescription
dataSource*TransferItem[]Full list of items (source + target)
targetKeys*string[]Keys of items in the right (target) panel
onChange*(targetKeys: string[]) => voidCalled when items are moved between panels
titles[string, string]["", ""]Labels for the source and target panels
showSearchbooleanfalseShow search box in each panel
render(item: TransferItem) => ReactNodeCustom render function for each item
disabledbooleanfalseDisable the entire transfer component