Forms Form-associated
Transfer <pm-transfer>
Transfer list: move items between "available" and "selected" (assign permissions, pick table columns).
States
Each state is one attribute.
DisabledRead-onlyRequiredErrorWith a hintOverview
Tick items and use the arrow buttons, or double-click an item to move it. In each list: Up and Down move, Space ticks, Enter moves the ticked items across, Ctrl+A ticks all. value is the selected values joined with commas, values the same as a list. Form-associated: submits one entry per selected item.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
options | TransferOption[] | [] | Every item that can be chosen. |
value | string | — | The selected values joined with commas, in the order they were added. Also accepts a list or a JSON array
(value='["a","b"]', as before 0.2.0); use values for values that contain commas. |
name | string | — | Form field name: one entry per selected item is submitted under it. |
label | string | Items | Visible label (use hide-label to hide it visually). |
hint | string | — | Help text under the lists. |
error | string | — | Custom error message. Setting it marks the field invalid. |
required | boolean | false | At least one item must be selected. |
disabled | boolean | false | Not interactive and not submitted. |
searchable | boolean | false | Show a filter box above each list. |
source-labelprop: sourceLabel | string | Available | Heading of the left list (default "Available"). |
target-labelprop: targetLabel | string | Selected | Heading of the right list (default "Selected"). |
height | string | — | Height of the lists: any CSS length (default 14rem). |
hide-labelprop: hideLabel | boolean | false | Hide the label visually; it stays the accessible name. |
readonly | boolean | false | Focusable and submitted, but the user cannot change the value. |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-change | onPmChange | The selection changed. detail.value is detail.values joined with commas. |
Methods
move(), checkValidity(), reportValidity(), validate()