Skip to content

Sortable List for Angular

AngularDrag, Drop and Interaction

A labelled, vertical, reorderable list with two equivalent input paths: pointer drag (mouse, pen, touch through pointer events; never HTML5 drag and drop) and keyboard reordering on each item’s handle button (Space or Enter grabs, arrow keys, Home and End move, Space or Enter drops, Escape or leaving the handle cancels). Every step is announced through the assertive live region. The moved item never leaves the DOM (its siblings move around it), so focus and pointer capture survive. The new order is reported with aui-change; persisting it is the consumer’s job.

  • Pointer or keyboardReorder by dragging, or grab with Space and move with the arrow keys.
  • Announced movesScreen readers hear every grab, move, drop, and cancel.
  • Handle or whole itemStart a drag from a handle or from anywhere on the item.
  • Programmatic movesMove items from code while the user sees the same result.

Behavior, design tokens, and limitations are described on the Sortable List page; this page covers the Angular API.

import { Component } from '@angular/core';
import type { SortableListChangeDetail, SortableListItem } from '@absoluteui/components/sortable-list';
import { AuiSortableList } from '@absoluteui/angular/sortable-list';
@Component({
selector: 'app-priorities',
imports: [AuiSortableList],
template: `<aui-sortable-list label="Priorities" [items]="items" (changed)="save($event.order)"></aui-sortable-list>`,
})
export class PrioritiesComponent {
items: SortableListItem[] = [
{ id: 'security', label: 'Security review' },
{ id: 'performance', label: 'Performance' },
{ id: 'docs', label: 'Documentation' },
];
save(order: SortableListChangeDetail['order']): void {
const byId = new Map(this.items.map((item) => [item.id, item] as const));
this.items = order.flatMap((id) => byId.get(id) ?? []);
// persist `order`
}
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiSortableList } from '@absoluteui/angular/sortable-list';

Defaults for every instance: provideAbsoluteUIConfig({ components: { sortableList: { ... } } }) (see Configuration).

Class AuiSortableList; template reference #ref="auiSortableList".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
label string Required. Accessible name of the list (aria-label on the <ul>). Must be non-empty after trimming.
items readonly SortableListItem[] Required. Items in order. Ids must be unique, non-empty, and stable; labels non-empty (used in the handle name and announcements). Rows are kept by id on update; the array order defines the DOM order.
disabled boolean false Disable reordering for the whole list (all handles disabled).
icons Partial<SortableListIcons> Icon slot overrides.
dragFrom SortableListDragFrom 'handle' Where a pointer drag can start: the handle only, or anywhere on a movable item (interactive content inside the item keeps its own pointer behavior).
Output Payload Description
(changed) SortableListChangeDetail Dispatched on the host after a keyboard or pointer drop that changed the item’s position. from and to are zero-based. Not emitted for cancels, drops in place, move(), or update(). Re-emits aui-change.
Property Type Description
isDragging Signal<boolean> Whether an item is grabbed (keyboard) or dragged (pointer).

Call them through a viewChild query or a template reference.

Method Description
move(id: string, index: number): void Move an item to a zero-based index; cancels an active grab or drag first. No event, no announcement. Throws SORTABLE_LIST_OPTIONS for an unknown id or an index outside 0..count-1.

Pattern: Reorderable list with a toggle-button grab handle per item and live-region announcements (keyboard drag-and-drop pattern). Native list semantics; no ARIA drag-and-drop attributes (aria-grabbed and aria-dropeffect are deprecated).

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Sortable List: Accessibility and performance.