v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

SortableList

Reorder items with drag or explicit move buttons.

Interactive preview

  1. Design the interface
  2. Build the components
  3. Review and ship

Usage

import { SortableList } from "@devvy-ui/react";

<SortableList label="Project order" items={items} onItemsChange={setItems} />

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
itemsSortableItem[]requiredStable ids, readable labels and optional content/disabled.
onItemsChange(items: SortableItem[]) => voidrequiredControlled order callback.
disabledbooleanfalseDisable reordering.

Accessibility & behavior

Platform Behavior & Guidelines

Native HTML drag accepts only this list's own payload. Move up/down buttons provide keyboard and touch alternatives and preserve keyed focus. Live status reports the new position.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add sortable-list

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

SortableList.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.