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
| Class | Description |
|---|---|
.vd-transfer | Auto-generated root container (flex layout with two panels) |
.vd-transfer-panel | Each side panel (Available / Selected) |
.vd-transfer-header | Panel header showing title and item count |
.vd-transfer-search | Search input inside each panel for filtering items |
.vd-transfer-list | Scrollable list container holding items |
.vd-transfer-item | Individual item row with a checkbox |
.vd-transfer-item.is-selected | Selected state on an item (ready to move) |
.vd-transfer-actions | Center column holding the move buttons |
.vd-transfer-btn | Arrow button to move checked items between panels |
Component API
| Prop / event / method | Description |
|---|---|
:items | Array of { id, label } objects; all start in the Source panel. |
transfer:change | Native event on the root; detail = { selected, available } (id arrays). |
ref.getSelected() | Exposed method — returns the current Target-panel id array. |
Events
| Event | Description |
|---|---|
transfer:change | Fired 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-selectedreflecting 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 witharia-label="Move to target"andaria-label="Move to source", automatically disabled when no items are checked in the corresponding list. - Search inputs are labelled with
aria-label="Search source"andaria-label="Search target", and panel count badges usearia-live="polite"to announce selection and total counts.