React Native · Components
Transfer
Moving items between two lists (same API as the web Transfer): role permissions, team members, columns to show and so on.
5 exports
Live example
The preview runs in the browser with the web component; the native component takes the same props and looks the same on iOS and Android.
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
componentMoving items between two lists (same API as the web Transfer): role permissions, team members, columns to show and so on.
- Selection: tap a row; the box in the header selects all visible ones. A long press moves the item to the other list immediately.
- Search: separate in each list, ignoring diacritics (including Turkish letters).
- Large lists: rows are rendered virtually (
FlatList). - Ordering: with
orderablethe target order changes with ↑/↓. - One way: with
oneWayitems are only added and target items are removed with ×. - Narrow screens: on phones the lists stack and the arrows turn down/up.
- Form: binds inside a
Formvianame.
Examples
TransferItem
interfaceAn item in the Transfer lists (same as web).
| Name | Type | Description |
|---|---|---|
value | string | Unique value; goes into the value array. |
label | ReactNode | Display name. If not text, keywords or value is used in search. |
description? | ReactNode | Description under the name (email, code, role). |
icon? | IconProp | Icon before the name. |
disabled? | boolean | Cannot be moved; if selected it stays in the target. |
keywords? | string | Extra text to match in search. |
TransferSide
typeSide of a Transfer list: source or target (selected).
TransferRenderContext
interfaceInformation passed to the Transfer renderItem function.
| Name | Type | Description |
|---|---|---|
side | TransferSide | The list the item is in. |
checked | boolean | Is it checked? |
query | string | Search text. |
TransferProps
interfaceTransfer props (same names as web).
Extends: FieldProps
| Name | Type | Default | Description |
|---|---|---|---|
items | readonly TransferItem[] | All items. Selected ones appear in the target list, the rest in the source. | |
value? | readonly string[] | Values of the selected items in controlled use, in their target order. | |
defaultValue? | readonly string[] | Initially selected items in uncontrolled use. | |
onValueChange? | (value: string[], items: TransferItem[]) => void | With the new values and items when the selection changes. | |
titles? | readonly [ReactNode, ReactNode] | ["Kaynak", "Seçilenler"] | List titles. |
search? | boolean | "auto" | "auto" | Search boxes; "auto" with more than 8 items. |
oneWay? | boolean | false | Items only move from source to target; target items are removed with ×. |
orderable? | boolean | false | The target order can be changed with ↑/↓ buttons. |
max? | number | At most this many items can move to the target. | |
height? | number | 240 | Height of each list (pixels). |
renderItem? | (item: TransferItem, context: TransferRenderContext) => ReactNode | Row content; defaults to icon, name and description. | |
footer? | (side: TransferSide) => ReactNode | Content added below the list. | |
empty? | (side: TransferSide) => ReactNode | Content shown in an empty list. | |
aria-label? | string | Screen reader name; give it when there is no visible label. | |
style? | StyleProp<ViewStyle> | Container style. |