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 1UI component #1
- Component 3UI component #3
- Component 5UI component #5
- Component 6UI component #6
- Component 7UI component #7
- Component 8UI component #8
- Component 9UI component #9
- Component 10UI component #10
Selected0/2
- Component 2UI component #2
- Component 4UI component #4
Installation
npx benflux-ui add transferUsage
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
| Prop | Type | Default | Description |
|---|---|---|---|
| dataSource* | TransferItem[] | — | Full list of items (source + target) |
| targetKeys* | string[] | — | Keys of items in the right (target) panel |
| onChange* | (targetKeys: string[]) => void | — | Called when items are moved between panels |
| titles | [string, string] | ["", ""] | Labels for the source and target panels |
| showSearch | boolean | false | Show search box in each panel |
| render | (item: TransferItem) => ReactNode | — | Custom render function for each item |
| disabled | boolean | false | Disable the entire transfer component |