Transfer / Dual List

The VdTransfer component renders a dual-panel picker — users move items from a "Source" list to a "Target" list using arrow buttons. Search filtering is built into both panels automatically, and selected items are accessible programmatically at any time.

Transfer
Source0/15
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • Python
  • Ruby
  • Go
  • Rust
  • Java
  • C#
  • PHP
  • Swift
  • Kotlin
  • Dart
  • Scala
Target0/0
API Reference

Usage

<script setup lang="ts">
import { VdTransfer } from "@vanduo-oss/vd3";
const items = [
  { id: 'html', label: 'HTML' },
  { id: 'css',  label: 'CSS' },
];
</script>

<template>
  <VdTransfer :items="items" />
</template>

CSS Classes

ClassDescription
.vd-transferAuto-generated root container (flex layout with two panels)
.vd-transfer-panelEach side panel (Available / Selected)
.vd-transfer-headerPanel header showing title and item count
.vd-transfer-searchSearch input inside each panel for filtering items
.vd-transfer-listScrollable list container holding items
.vd-transfer-itemIndividual item row with a checkbox
.vd-transfer-item.is-selectedSelected state on an item (ready to move)
.vd-transfer-actionsCenter column holding the move buttons
.vd-transfer-btnArrow button to move checked items between panels

Component API

Prop / event / methodDescription
:itemsArray of { id, label } objects; all start in the Source panel.
transfer:changeNative event on the root; detail = { selected, available } (id arrays).
ref.getSelected()Exposed method — returns the current Target-panel id array.

Events

EventDescription
transfer:changeFired on the element when items are moved. event.detail contains { selected: string[], available: string[] }
Accessibility
  • Each panel list renders <ul role="listbox" aria-multiselectable="true">, and each item renders <li role="option"> with :aria-selected reflecting its checked state.
  • Each row includes a native <input type="checkbox" :aria-label="item.label"> for assistive technology labelling.
  • The transfer action buttons are native <button type="button"> elements with aria-label="Move to target" and aria-label="Move to source", automatically disabled when no items are checked in the corresponding list.
  • Search inputs are labelled with aria-label="Search source" and aria-label="Search target", and panel count badges use aria-live="polite" to announce selection and total counts.