Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Forms Form-associated

Transfer <pm-transfer>

Transfer list: move items between "available" and "selected" (assign permissions, pick table columns).

Full screen

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/transfer'; </script> <pm-transfer label="Table columns" name="columns" source-label="Hidden" target-label="Shown" value='["name","email"]' style="inline-size: min(100%, 34rem)" options='[{"value":"name","label":"Name"},{"value":"email","label":"Email"},{"value":"role","label":"Role"},{"value":"team","label":"Team"},{"value":"status","label":"Status"},{"value":"created","label":"Created"},{"value":"last","label":"Last active"}]'></pm-transfer>

States

Each state is one attribute.

Disabled
Read-only
Required
Error
With a hint

Overview

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

AttributeTypeDefaultDescription
optionsTransferOption[][]Every item that can be chosen.
valuestring—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.
namestring—Form field name: one entry per selected item is submitted under it.
labelstringItemsVisible label (use hide-label to hide it visually).
hintstring—Help text under the lists.
errorstring—Custom error message. Setting it marks the field invalid.
requiredbooleanfalseAt least one item must be selected.
disabledbooleanfalseNot interactive and not submitted.
searchablebooleanfalseShow a filter box above each list.
source-label
prop: sourceLabel
stringAvailableHeading of the left list (default "Available").
target-label
prop: targetLabel
stringSelectedHeading of the right list (default "Selected").
heightstring—Height of the lists: any CSS length (default 14rem).
hide-label
prop: hideLabel
booleanfalseHide the label visually; it stays the accessible name.
readonlybooleanfalseFocusable 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

EventReact / Svelte propDescription
pm-changeonPmChangeThe selection changed. detail.value is detail.values joined with commas.

Methods

move(), checkValidity(), reportValidity(), validate()