Order list

Puts the items of one list in order. Select items, then move them with the buttons beside the list or with Alt and the arrow keys; every move is announced.

  • vig-order-list
  • ng-template[vigListItem]
Import
import { OrderList } from '@vigdx/ui/order-list';
import { ListItemTemplate } from '@vigdx/ui/listbox';

Basic

Bind the items with [(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.

Priorities
Security review
Release notes
Docs update
Performance pass
Design QA

Order: Security review → Release notes → Docs update → Performance pass → Design QA

Any item type, a template and dragging

Items can be objects: 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).

Playlist
Blue in GreenMiles Davis
NaimaJohn Coltrane
Peace PieceBill Evans
FootprintsWayne Shorter

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"]

OrderList styling hooks
Part Element data-state
root The vig-order-list host. —
controls The column of move buttons. —
move-top The "Move to top" vig-button . —
move-up The "Move up" vig-button . —
move-down The "Move down" vig-button . —
move-bottom The "Move to bottom" vig-button . —
list The vig-listbox ; style its own [data-scope="listbox"] parts. —
status The visually hidden polite region announcing moves. —

Accessibility

  • The list is a multi-selectable role="listbox" named by heading: 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-list component

Reorders 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.

Example :
<vig-order-list heading="Playlist" [(value)]="songs" [itemLabel]="songTitle" />
OrderList props
Name Type Default Description
disabledbooleanfalse

Blocks selecting and moving; the lists stay focusable for reading.

dragDropbooleanfalse

Also reorder by dragging with a pointer; the buttons and keys stay the primary way.

heading required 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.

labelsPartial<OrderListLabels>—

Texts (i18n) over the locale defaults.

selection model T[][]

The selected items, which the buttons and Alt+keys move.

sizeFieldSize'md'

Text size, option padding and button size.

value model T[][]

The items in their order; every move writes a new array.

ListItemTemplate

ng-template[vigListItem] directive

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.

Example :
<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>
ListItemTemplate props
Name Type Default Description
vigListItemOfreadonly T[] | null | undefinedundefined

Type-only: the items the template renders, so the template type checker infers the item type. Not read at runtime.

Are you sure?