Skip to content

Transfer

YhTransfer moves items between two lists and is suitable for permission assignment, role binding, and dual-list selection workflows.

Basic Usage

List 14 items
  • California
  • Maryland
  • Florida
  • Colorado
List 22 items
  • Illinois
  • Texas
Basic Usage

Filtering

Enable filterable to show a search box in each panel header, and use filter-method when you need custom matching logic.

List 16 items
  • California
  • Illinois
  • Maryland
  • Texas
  • Florida
  • Colorado
List 20 items
No data
Filtering

Field Mapping

When your business data does not use the default key, label, or disabled fields, configure aliases through props.

List 13 items
  • R&D Dept
  • HR Dept
  • Finance Dept
List 21 items
  • Marketing Dept
Field Mapping

Use the default item slot and the header / empty / footer slots on both panels for richer business-side layouts and actions. The declared render-content prop is not currently consumed by the runtime template.

List 16 items
  • 1 - California
  • 2 - Illinois
  • 3 - Maryland
  • 4 - Texas
  • 5 - Florida
  • 6 - Colorado
List 20 items
No data
Custom Content and Footer Slots

Virtual Scrolling

For large datasets, enable virtual and tune the panel window with height and item-height.

List 1300 items
  • Option 1
  • Option 2
  • Option 3
  • Option 4
  • Option 5
  • Option 6
  • Option 7
  • Option 8
  • Option 9
  • Option 10
  • Option 11
  • Option 12
  • Option 13
  • Option 14
List 20 items
No data
Virtual Scrolling

Use in Nuxt

After enabling the YH-UI Nuxt module, YhTransfer can be used directly in pages and components. List data, default selected keys, and custom titles can render during SSR, while checkbox selection, filtering, and move actions continue after client hydration.

List 14 items
  • California
  • Maryland
  • Florida
  • Colorado
List 22 items
  • Illinois
  • Texas
Use in Nuxt

API

Props

NameDescriptionTypeDefault
model-value / v-modelKeys currently placed in the target listTransferKey[][]
dataData sourceTransferData[][]
filterableWhether filtering is enabledbooleanfalse
filter-methodCustom filter function(query: string, item: TransferData) => booleanundefined
filter-placeholderSearch input placeholder; falls back to locale text when omittedstringundefined
target-orderOrdering strategy for the target list'original' | 'push' | 'unshift''original'
titlesTitle array for the two panelsstring[][]
button-textsText array for the middle action buttonsstring[][]
render-contentDeclared custom item render function. It is passed down to the panel, but the current panel template does not consume it(h, data) => VNode | stringundefined
left-default-checkedInitially checked keys in the left panelTransferKey[][]
right-default-checkedInitially checked keys in the right panelTransferKey[][]
propsField alias mapping{ key?: string; label?: string; disabled?: string }undefined
disabledWhether the whole component is disabledbooleanfalse
sizeComponent size'large' | 'default' | 'small''default'
validate-eventCompatibility prop. The current transfer implementation does not consume it to emit form validation eventsbooleantrue
virtualWhether virtual scrolling is enabledbooleanfalse
item-heightRow height in virtual modenumber40
heightPanel heightnumber280
left-titleLeft panel titlestringundefined
right-titleRight panel titlestringundefined
show-all-checkboxDeclared select-all visibility prop. The current panel header still renders the select-all entry regardless of this valuebooleantrue
empty-textShared empty-state text for both panelsstringundefined
left-empty-textEmpty-state text for the left panelstringundefined
right-empty-textEmpty-state text for the right panelstringundefined
theme-overridesComponent-level theme overridesComponentThemeVarsundefined

Events

NameDescriptionParameters
update:modelValueTriggered when target keys change(value: TransferKey[])
changeTriggered after items move left or right(value: TransferKey[], direction: 'left' | 'right', movedKeys: TransferKey[])
left-check-changeTriggered when checked keys change in the left panel(value: TransferKey[], movedKeys?: TransferKey[])
right-check-changeTriggered when checked keys change in the right panel(value: TransferKey[], movedKeys?: TransferKey[])

Slots

NameDescriptionParameters
defaultCustom list item content{ option: TransferData }
buttonsCustom middle action area{ moveToLeft: () => void; moveToRight: () => void; leftChecked: TransferKey[]; rightChecked: TransferKey[] }
left-headerLeft panel header content-
right-headerRight panel header content-
left-emptyLeft panel empty content-
right-emptyRight panel empty content-
left-footerLeft panel footer content-
right-footerRight panel footer content-

Expose

NameDescriptionType
clearLeftCheckedClears checked state in the left panel() => void
clearRightCheckedClears checked state in the right panel() => void
leftPanelLeft panel instance refRef<TransferPanelExpose | undefined>
rightPanelRight panel instance refRef<TransferPanelExpose | undefined>

Theme Variables

YhTransfer supports themeOverrides, but it does not currently expose dedicated component-scoped CSS variables. It mainly consumes global theme tokens and text / border colors.

Type Exports

NameDescription
YhTransferPropsProps type for YhTransfer
YhTransferEmitsEmits type for YhTransfer
YhTransferExposeExpose type for YhTransfer
YhTransferPanelExposeExpose type for the transfer panel
YhTransferInstancePublic transfer instance type
YhTransferPanelInstancePublic panel instance type
TransferDataData item type
TransferKeyKey type for transfer items
TransferDirectionDirection type for move operations
TransferSizeSize type
TransferPropsAliasField alias config type
TransferFilterMethodFilter function type
TransferRenderContentCustom render function type

Released under the MIT License.