Skip to content

Reorder list

Pro

A vertical list whose rows a person puts in order: by dragging a handle, with the arrow keys, or from a move menu with no drag at all, each move said to screen readers. Not an M3 component (@windmorph/react-pro).

import { ReorderList, ReorderListItem, useReorderListItem } from '@windmorph/react-pro';

Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.

Playground

  • Soak the beans
  • Rinse and drain
  • Simmer
  • Season
  • Let it rest

Code

import { useState } from 'react';import { ReorderList, ReorderListItem } from '@windmorph/react-pro'; export function Example() {  const [order, setOrder] = useState(['Soak the beans', 'Rinse and drain', 'Simmer']);   return (    <ReorderList      aria-label="Recipe steps"      onReorder={(keys) => setOrder(keys as string[])}    >      {order.map((step) => (      <ReorderListItem key={step} textValue={step}>        {step}      </ReorderListItem>    ))}    </ReorderList>  );}

Examples

Steps put in order

A row's own menu, a fixed row and the handle at the end