Pick list
vig-pick-list ng-template[vigListItem]
import { PickList } from '@vigdx/ui/pick-list';
import { ListItemTemplate } from '@vigdx/ui/listbox';Basic
[(source)] and [(target)] and name them with sourceHeading and targetHeading . Moved items are appended to the other list.
Basket: Coffee
Filter, reorder, drag and a template
filter adds a search field to each list; “Move all” then moves only the matching items. reorder adds order buttons to the target, dragDrop pointer dragging between and within the lists. itemLabel names object items and a vigListItem template renders them; (moved) reports every transfer, and [(sourceSelection)] / [(targetSelection)] expose what is selected.
Nothing moved yet.
Related components
Each list is a listbox in multiple mode. For a single list to put in order, use an order list; to pick a few values in a form, a multi select or a listbox takes less room.
Styling hooks
Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="pick-list"][data-part="root"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.
Scope: [data-scope="pick-list"]
| Part | Element | data-state |
|---|---|---|
root | vig-pick-list host, the container whose width stacks the lists. | — |
source | vig-listbox ; style its [data-scope="listbox"] parts. | — |
transfer | — | |
move-to-target | — | |
move-all-to-target | — | |
move-to-source | — | |
move-all-to-source | — | |
target | vig-listbox ; style its [data-scope="listbox"] parts. | — |
controls | reorder ). | — |
move-top | reorder ). | — |
move-up | reorder ). | — |
move-down | reorder ). | — |
move-bottom | reorder ). | — |
status | — |
Accessibility
- Both lists are multi-selectable
role="listbox"elements named by their headings; each has its own tab stop, with the buttons between them. - The buttons are named after the list they move to, e.g. “Move selected to Basket” and “Move all to Basket” (
labels), and are disabled while there is nothing to move. When the button you used becomes disabled, focus continues in the list the items came from, or in the other one once it is empty. - From a list, Alt+ArrowRight moves the selection (or the active item) towards the target and Alt+ArrowLeft back; both are mirrored in right-to-left pages. With
reorder, Alt+ArrowUp/ArrowDown and Alt+Home/End order the target. - Every move is announced in a polite live region, e.g. “2 items moved to Basket”.
- The layout follows the container, not the viewport: below 36rem the lists stack and the transfer arrows turn to point down and up. Start and end are logical, so in right-to-left pages the source list is on the right.
API
PickList
vig-pick-listTwo lists — the available source items and the chosen target ones —
with buttons moving the selected or all shown items between them. Each
list can be filtered (filter); reorder adds order buttons to the
target. Keyboard: select in a list, then Alt+ArrowRight moves the
selection towards the target and Alt+ArrowLeft back (mirrored in RTL),
Alt+ArrowUp/ArrowDown/Home/End reorder the target; every move is
announced. The lists sit side by side and stack in a narrow container.
<vig-pick-list sourceHeading="Available" targetHeading="Chosen"
[(source)]="available" [(target)]="chosen" [itemLabel]="name" filter />| Name | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Blocks selecting and moving; the lists stay focusable for reading. |
dragDrop | boolean | false | Also move items by dragging with a pointer; buttons and keys stay the primary way. |
filter | boolean | false | A filter field above each list. |
itemLabel | (item: T) => string | (item) => String(item) | Text of an item, for its accessible name, filtering, typeahead and default rendering. |
labels | Partial<PickListLabels> | — | Texts (i18n) over the locale defaults. |
reorder | boolean | false | Order buttons (and Alt+arrow keys) for the target list. |
size | FieldSize | 'md' | Text size, option padding and button size. |
source | T[] | [] | The items still available. |
sourceHeading | string | — | Visible name of the source list. |
sourceSelection | T[] | [] | The selected items of the source list, which "move selected" moves. |
target | T[] | [] | The chosen items, in their order. |
targetHeading | string | — | Visible name of the target list. |
targetSelection | T[] | [] | The selected items of the target list. |
| Name | Payload | Description |
|---|---|---|
moved | PickListMoveEvent<T> | Items moved between the lists, by a button, a key or a drop. |
sourceChange | T[] | The items still available. |
sourceSelectionChange | T[] | The selected items of the source list, which "move selected" moves. |
targetChange | T[] | The chosen items, in their order. |
targetSelectionChange | T[] | The selected items of the target list. |
ListItemTemplate
ng-template[vigListItem]Custom rendering for the items of vig-order-list and vig-pick-list,
replacing the default label. Bind the same items to vigListItemOf (like
ngForOf) to type let-item; without it the item is unknown.
<vig-order-list heading="Tasks" [(value)]="tasks" [itemLabel]="taskLabel">
<ng-template vigListItem [vigListItemOf]="tasks" let-task>
<span class="truncate">{{ task.title }}</span>
<vig-tag class="ms-auto" [value]="task.status" />
</ng-template>
</vig-order-list>| Name | Type | Default | Description |
|---|---|---|---|
vigListItemOf | readonly T[] | null | undefined | undefined | Type-only: the items the template renders, so the template type checker infers the item type. Not read at runtime. |