Skip to main content

Transfer

Ant Design

The Transfer component is Ant Design's two-list picker. Users tick items in one list and move them to the other, for example to choose which reports a role can see.

Properties​

Property
Description
Expected Value
Data sourceThe items, each with a unique key and a title, such as [{ key: 'orders', title: 'Orders' }]. An item with disabled: true can't be moved.Array
Target keysKeys of the items in the right-hand list. It updates as the user moves items.Array
TitlesHeadings of the two lists, left then right, such as ['Available', 'Selected'].Array. Default: ["Available", "Selected"]
Show searchShows a search box above each list that filters items by title.On or off. Default: On
One wayOnly lets items move to the right. Items on the right get a remove icon instead of a move back button.On or off. Default: Off

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On changeTriggers when items move between the lists.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set field valueSets which items are on the right to the keys in the given Value.components.transfer1.setFieldValue("")
Reset fieldSets the right-hand list back to the Target keys property.components.transfer1.resetFields()
Set visibilityShows the component when true, hides it when false.components.transfer1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.transfer1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.transfer1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataSourceThe items, each with a unique key and a title, such as [{ key: 'orders', title: 'Orders' }]. An item with disabled: true can't be moved.{{components.transfer1.dataSource}}
targetKeysKeys of the items in the right-hand list. It updates as the user moves items.{{components.transfer1.targetKeys}}
titlesHeadings of the two lists, left then right, such as ['Available', 'Selected'].{{components.transfer1.titles}}
showSearchShows a search box above each list that filters items by title.{{components.transfer1.showSearch}}
oneWayOnly lets items move to the right. Items on the right get a remove icon instead of a move back button.{{components.transfer1.oneWay}}
valueKeys of the items in the right-hand list, the same as Target keys. A Form reads this key.{{components.transfer1.value}}
isVisibleWhether the component is visible.{{components.transfer1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.transfer1.isLoading}}
isDisabledWhether the component is disabled.{{components.transfer1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.