Components · Data Display
Sortable
A list people reorder by dragging or with Alt+Arrow keys on a handle.
import { Sortable } from '@nexub/react';Playground
Props
- Revenue
- Active users
- Churn
- Support tickets
<Sortable aria-label="Dashboard widgets" items={widgets} getId={(w) => w} getLabel={(w) => w} onReorder={setWidgets} className="w-full max-w-sm">…</Sortable>Examples
Widget order
Grid
Cards that wrap; the items have no id.
Flat, locked and disabled
A dense list in a card: the first column is locked, and the switch turns editing off.
Groups
Move stories between the backlog and the sprint, by drag or Alt+ArrowLeft / Alt+ArrowRight.
States
- Revenue
- Active users
- Churn
- Support tickets
default- Revenue
- Active users
- Churn
- Support tickets
disabled- Revenue
- Active users
- Churn
- Support tickets
variant="default"- Revenue
- Active users
- Churn
- Support tickets
variant="flat"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| items | T[] | — | The list, in order. Not used with list. |
| getLabel | ((item: T) => string) | — | The name read in "Move ‹label›" and the move announcements. Defaults to String(item): pass it for objects. |
| getId | ((item: T) => string) | — | Stable key. Defaults to item.id, else a key kept per object, else the value itself (keep string values unique). |
| onReorder | ((items: T[]) => void) | — | Called with the new order; store it. Not used with list. |
| childrenrequired | (item: T) => React.ReactNode | — | The item’s content; the handle sits before it. |
| aria-label | string | — | Names the list. Inside a group it defaults to the list’s label. |
| layout | 'list' | 'grid' | 'list' | Default list. grid wraps items into cells (cards, images); Alt+Arrow keys move an item by one cell or row. |
| variant | 'default' | 'flat' | 'default' | Default default. flat drops the card chrome around items, for dense lists inside a card. |
| disabled | boolean | — | Turns every handle off: nothing moves. |
| isLocked | ((item: T) => boolean) | — | Locked items show a lock, can’t be moved, and keep their index while others move around them, so nothing lands above a locked first item. |
| list | string | '' | Inside Sortable.Group: which of its lists this renders (instead of items / onReorder). |
| Sortable.Group | { lists: { id, label, items }[]; onChange; getLabel; getId?; isLocked?; disabled? } | — | Owns several lists items move between; onChange gets every list after a move. |
| className | string | — |
Accessibility
Keyboard
- Alt+ArrowUp / Alt+ArrowDown
On a handle: moves the item (by a row in a grid); focus stays on its handle.
- Alt+ArrowLeft / Alt+ArrowRight
In a grid, moves the item by one cell; in a group, to the previous or next list. Mirrored in RTL.
Notes
Every handle is a button named "Move ‹label›", described by the key hint.
Moves are announced: "Alpha moved to position 3 of 5", or "Alpha moved to Sprint, position 1 of 2" across lists.
A locked item’s handle is disabled and named "‹label› is locked".
Dragging uses Pointer Events (mouse, pen, touch; Escape cancels), so there is no extra dependency. The settle animation is off under reduced motion.
On iOS & Android: SortableList
import { SortableList } from '@nexub/react-native';
<SortableList items={widgets} keyExtractor={(w) => w.id} title={(w) => w.name} onReorder={setWidgets} />Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Moving | Drag, or Alt+Arrow on a handle. | Move up / down buttons, and the same moves as VoiceOver and TalkBack actions. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
SortableList props
| Prop | Type | Default | Description |
|---|---|---|---|
| itemsrequired | T[] | — | — |
| keyExtractorrequired | (item: T) => string | — | — |
| titlerequired | (item: T) => string | — | — |
| subtitle | (item: T) => string | undefined | — | — |
| onReorderrequired | (items: T[]) => void | — | — |
| editing | boolean | true | Shows the move buttons. Screen readers always get Move up / Move down actions. |
| style | StyleProp<ViewStyle> | — | — |