Order list
vig-order-list ng-template[vigListItem]
import { OrderList } from '@vigdx/ui/order-list';
import { ListItemTemplate } from '@vigdx/ui/listbox';Basic
[(value)] : each move writes a new array. heading names the list. The buttons move the selected items one step or to the top or bottom, keeping their relative order.
Order: Security review → Release notes → Docs update → Performance pass → Design QA
Any item type, a template and dragging
itemLabel names each one (accessible name, typeahead, announcements) and a vigListItem template renders it, typed by vigListItemOf . [(selection)] exposes the selected items and (reordered) reports each move. dragDrop adds pointer dragging on top of the buttons and keys; from 500 items the list is virtualized and does not drag (a dev-mode warning says so).
0 selected
Related components
The list is a listbox in multiple mode, so it is selected and browsed the same way. To choose items from one list into another, use a pick list.
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="order-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="order-list"]
| Part | Element | data-state |
|---|---|---|
root | vig-order-list host. | — |
controls | — | |
move-top | vig-button . | — |
move-up | vig-button . | — |
move-down | vig-button . | — |
move-bottom | vig-button . | — |
list | vig-listbox ; style its own [data-scope="listbox"] parts. | — |
status | — |
Accessibility
- The list is a multi-selectable
role="listbox"named byheading: click, Space, Shift+arrows and Ctrl/Cmd+A select. - The move buttons are named “Move to top”, “Move up”, “Move down” and “Move to bottom” (
labels) and are disabled while the selection cannot move that way. When the button you used becomes disabled, focus continues in the list. - From the list, Alt+ArrowUp and Alt+ArrowDown move the selection one step, Alt+Home and Alt+End to the top and bottom (Option on macOS); with nothing selected they move the active item.
- Each move is announced in a polite live region, e.g. “Release notes moved to position 3 of 5” (
labels.reorderedAnnouncement). - Dragging is an extra for pointer users; the buttons and keys stay the way to reorder. A virtualized list (from 500 items) does not drag.
API
OrderList
vig-order-listReorders one list. Select items (Space, Shift+arrows, Ctrl/Cmd+A, click)
and move them with the buttons beside the list or Alt+ArrowUp/ArrowDown
(one step) and Alt+Home/End (to the top or bottom); with nothing selected
the keys move the active item. Each move is announced politely.
dragDrop adds pointer dragging on top. value is the ordered array:
bind it two-way.
<vig-order-list heading="Playlist" [(value)]="songs" [itemLabel]="songTitle" />| Name | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Blocks selecting and moving; the lists stay focusable for reading. |
dragDrop | boolean | false | Also reorder by dragging with a pointer; the buttons and keys stay the primary way. |
heading | string | — | Visible name of the list. |
itemLabel | (item: T) => string | (item) => String(item) | Text of an item, for its accessible name, typeahead and default rendering. |
labels | Partial<OrderListLabels> | — | Texts (i18n) over the locale defaults. |
selection | T[] | [] | The selected items, which the buttons and Alt+keys move. |
size | FieldSize | 'md' | Text size, option padding and button size. |
value | T[] | [] | The items in their order; every move writes a new array. |
| Name | Payload | Description |
|---|---|---|
reordered | OrderListReorderEvent<T> | Items moved by a button, a key or a drop; |
selectionChange | T[] | The selected items, which the buttons and Alt+keys move. |
valueChange | T[] | The items in their order; every move writes a new array. |
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. |