Components/Transfer

Transfer

A control that moves items between two lists.

VerifiedSince 0.3.4

Usage

Filterable Transfer

filterable shows a filter input on both sides; emptyText localizes the empty state.

Loading demo...

Ranked Target List

orderable shows ranks and move up / move down in the target panel, in modelValue order; maxHeight keeps long lists scrolling inside the panel.

Loading demo...

Permission Resource Grants

TxTransfer only moves resources under host control; TxTree, TxTreeSelect, and TxTimeline handle the scope, owner team, and audit trail.

Loading demo...

Best Practices

  • Keep modelValue controlled by the host and store only item keys; keep every data[].key unique and stable.
  • Keep disabled rows in data rather than filtering them out, so unavailable resources don't look missing.
  • Use targetOrder="push" when selection order matters; turn on orderable when users rank the target by hand (priorities, fallback chains).
  • Inside a dialog or drawer, set maxHeight to fit the container (e.g. min(56dvh, 520px)); lower minHeight in compact spots.
  • In a localized UI, override titles, emptyText, and every *AriaLabel prop.

API Reference

Props

PropertyTypeDefaultDescription
modelValueKeys shown in the target list.
dataAll items, each with key, label, and optional disabled.
titlesSource and target panel titles.
filterableShows a filter input on both sides.
filterPlaceholderPlaceholder of the filter input.
emptyTextText for an empty panel; a tuple gives each side its own.
maxHeightPanel height cap, px for numbers; writes --tx-transfer-max-height.
minHeightPanel height floor, px for numbers; writes --tx-transfer-min-height.
addAriaLabelAccessible name of the add button.
removeAriaLabelAccessible name of the remove button.
selectAllAriaLabelAccessible name of each select-all box, followed by the panel title.
moveUpAriaLabelAccessible name of the move-up button, followed by the row label.
moveDownAriaLabelAccessible name of the move-down button, followed by the row label.
targetOrderOrders the target by original data order or append order; ignored with `orderable`.
orderableShows ranks and move up/down in the target panel; order follows modelValue.

Events

EventPayloadDescription
update:modelValueArray<string | number>Selected keys updated.
changeArray<string | number>Fires together with update:modelValue.

Overview

  • Each panel's select-all box covers only visible, enabled rows; a partial selection reports aria-checked="mixed".
  • Rows move by checking them and pressing a middle button, or by double-clicking; double-clicking a disabled row does nothing.
  • A middle button turns primary and shows the pending count once rows are checked; with none checked it is disabled.
  • With orderable, ranks and first/last checks come from the unfiltered modelValue, so filtering never shifts them.

Technologies

  • Panels read --tx-transfer-max-height (default 320px) and --tx-transfer-min-height (default 240px); the props only write those variables, and the cap keeps scrolling inside the list.
  • Source: packages/tuffex/packages/components/src/transfer/.
View source
packages/tuffex/packages/components/src/transfer/index.ts