Web · Components
Transfer
Transfer between two lists: pick from the long list on the left, move to the right.
6 exports
Live example
Preview
All permissions8
Add / edit usersusers.write
Delete usersusers.delete
View ordersorders.read
Issue refundsorders.refund
Reportsreports.read
Export reportsreports.export
Change settingssettings.write
Audit logaudit
Role permissions2
View usersusers.read
Billingbilling
Code
Events
- Events appear here when you interact with the preview.
Import
Transfer between two lists: pick from the long list on the left, move to the right. For role permissions, team members, columns shown in a table, email recipients.
- Selection: click a row or press Space; Shift for a range, Ctrl/⌘ + A for all. Double-click or Enter moves a single item across right away.
- Search: separate in each list, insensitive to locale-specific letters; "select all" selects only the visible ones.
- Large lists: rows are virtualized; 10,000 items scroll smoothly.
- Ordering: with
orderablethe order on the right changes with ↑/↓ or Alt + arrow; the value comes back in this order. - One way: with
oneWayitems are only added; those on the right are removed with ×. - Mobile and narrow areas: when the container narrows the lists stack and the arrows turn up/down; rows grow for touch.
- Form: with
nameeach selected value is submitted separately;requiredandmaxwork.
For label, description and error see TransferField.
Examples
TransferItem
interfaceAn item in the Transfer lists.
| Name | Type | Description |
|---|---|---|
value | string | Unique value; goes into the form and the value array. |
label | ReactNode | Visible name. If it isn't text, keywords or value is used in search. |
description? | ReactNode | Description below the name (email, code, role). |
icon? | IconProp | Icon or avatar before the name. |
disabled? | boolean | Can't be moved; if selected it stays in the target. |
keywords? | string | Extra text to match in search (e.g. the label's translation, an abbreviation). |
TransferSide
typeSide of a Transfer list: source or target (the selected ones).
TransferRenderContext
interfaceInfo given to the renderItem function of Transfer.
| Name | Type | Description |
|---|---|---|
side | TransferSide | The list the item is in. |
checked | boolean | Is it checked? |
query | string | Search text (if you want to highlight it). |
TransferClassNames
interfaceClasses that can be passed to the inner parts of Transfer.
| Name | Type | Description |
|---|---|---|
list? | string | Both list boxes. |
header? | string | List title. |
item? | string | Row. |
actions? | string | Move buttons in the middle. |
TransferProps
interfaceProps of the Transfer component.
| Name | Type | Default | Description |
|---|---|---|---|
items | readonly TransferItem[] | All items. Selected ones show on the right, the rest on the left. See TransferItem. | |
value? | readonly string[] | Values of the selected ones in controlled use, in their order on the right. | |
defaultValue? | readonly string[] | Initially selected ones in uncontrolled use. | |
onValueChange? | (value: string[], items: TransferItem[]) => void | Called with the new values and items when the selection changes. | |
titles? | readonly [ReactNode, ReactNode] | List titles. @defaultValue ["Kaynak", "Seçilenler"] (messages.transferSource, messages.transferTarget) | |
search? | boolean | "auto" | "auto" | Search boxes; insensitive to locale-specific letters. "auto" turns them on with more than 8 items. |
oneWay? | boolean | false | Items only move from left to right; items on the right are removed with ×. For picking a few items from a long list (recipients, permissions). |
orderable? | boolean | false | The order on the right can be changed: move checked items with the ↑/↓ buttons, or Alt + arrow on the keyboard (column order, priority list). |
max? | number | At most this many items can move to the right. | |
height? | number | string | "18rem" | Height of the lists. |
renderItem? | (item: TransferItem, context: TransferRenderContext) => ReactNode | Content of a row; if omitted, the icon, name and description are drawn. | |
footer? | (side: TransferSide) => ReactNode | Content added below the list (e.g. an "Add new" button). | |
empty? | (side: TransferSide) => ReactNode | Content shown in an empty list. | |
itemHeight? | number | 40 | Estimated row height (px); the virtual list measures, this is for the first render. |
name? | string | Form field name; each selected value is submitted separately (getAll(name)). | |
form? | string | Id of the form the field belongs to. | |
required? | boolean | The form can't be submitted without at least one selected item. | |
disabled? | boolean | Disabled. | |
id? | string | Id of the source list (the label's htmlFor). | |
tooltip? | TooltipProp | Tooltip when hovering the container. See TooltipProp. | |
className? | string | Classes added to the container. | |
classNames? | TransferClassNames | Classes added to the inner parts. | |
aria-label? | string | Screen reader name. | |
aria-labelledby? | string | Id of the element naming the component. | |
aria-describedby? | string | Id of the element describing the component. | |
aria-invalid? | boolean | "true" | "false" | Show as invalid. |