# Sortable list

Reorder rows by drag or keyboard.

Import from `@a31labs/rax/sortable-list`.

## Usage

```tsx
// Drag a row by its grip, or focus the grip and use Arrow Up, Arrow Down, Home and End.
<SortableList label="Steps" items={steps} getId={s => s.id} itemLabel={s => s.name} renderItem={s => s.name} onReorder={setSteps} />
```

## Rules

Props: `items`, `getId`, `renderItem`, `onReorder` (called with the new array), `label` (list name), `itemLabel` (used in announcements). Drag-to-reorder with no dependencies. Each row has a grip IconButton ("Reorder X"), and only a held grip makes the row draggable, so row text stays selectable. On the focused grip, Arrow Up and Arrow Down move the row by one and Home and End move it to the top or bottom; focus stays on the grip. Moves are announced in a hidden live region ("Moved X to position 3 of 5"). While dragging, the drop target shows a 2px accent line and the dragged row is dimmed.

Page: https://rax.a31.at/components/sortable-list
