Transfer List
x-bladewind::transfer-list moves items between two panels, "Available" and
"Selected", with per-panel search and select-all, arrow controls in the middle, and a double-click on any
row as a shortcut for moving just that one item. It submits as a normal array field: only items currently in
the "Selected" panel are enabled, so the form only ever sends what is actually selected.
<x-bladewind::transfer-list
name="roles"
:items="[
['value' => 1, 'label' => 'Editor'],
['value' => 2, 'label' => 'Viewer'],
['value' => 3, 'label' => 'Admin'],
['value' => 4, 'label' => 'Billing Manager'],
['value' => 5, 'label' => 'Support Agent'],
]"
:selected="[2]"
/>
items accepts an array or a JSON string; each item needs at least a
value and a label key (override the key names with
valueKey/labelKey, exactly like Select).
selected lists which values start in the right-hand panel. On submit, this
example sends roles[] for every item currently on the right.
Custom value/label keys
<x-bladewind::transfer-list
name="roles"
:items="[['id' => 1, 'name' => 'Editor'], ['id' => 2, 'name' => 'Viewer']]"
value-key="id"
label-key="name"
/>
Panel labels and size
Override the panel headings with availableLabel/selectedLabel,
and each panel's height (in pixels) with height.
<x-bladewind::transfer-list
name="roles"
:items="$items"
available-label="Not assigned"
selected-label="Assigned"
height="180"
/>
Search
Each panel gets its own search box by default, filtering that panel's rows as you type. Set
searchable="false" to remove both boxes, worth doing once a list is short enough
that scanning it is faster than typing.
Full List Of Attributes
| Option | Default | Available Values |
|---|---|---|
| name | auto-generated | Field name the selected values submit under, as name[]. |
| items | [] | Array or JSON string of items, each with a value and a label key. |
| valueKey | value | Key read as each item's value. |
| labelKey | label | Key read as each item's display label. |
| selected | [] | Values that start in the "Selected" panel. |
| availableLabel | Available | Left panel heading. |
| selectedLabel | Selected | Right panel heading. |
| searchable | true | Shows a per-panel search box. |
| height | 260 | Height, in pixels, of each panel. |
| class | (blank) | Additional CSS classes for the wrapper element. |
Transfer List with all attributes defined
<x-bladewind::transfer-list
name="roles"
:items="[['value' => 1, 'label' => 'Editor']]"
value-key="value"
label-key="label"
:selected="[1]"
available-label="Available"
selected-label="Selected"
searchable="true"
height="260"
class="ml-2" />
resources > views > components > bladewind > transfer-list.blade.php