Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-sortable-list.json --yes

Sortable list

Pro

A list of rows a person puts in order, by dragging a row's handle or by the keys (Space, the arrows, Space), each step said aloud, for React and Tailwind CSS. Part of Goop Pro.

When to use

  • A list of rows a person puts in order, by dragging a row's handle or by the keys (Space, the arrows, Space), each step said aloud.
  • Use it wherever a person sets an order (steps, questions, priorities), never up and down buttons by hand. A list of Items in an order you set with handles beside them is the ItemReorderGroup; a list in a fixed order is a ListGroup or a Card of rows.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Sortable list on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-sortable-list.json --yes
PROMPT
Add the Goop Sortable list to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { useState } from 'react';
import { SortableList } from '@/components/ui/goop/sortable-list';

function StudySteps() {
  const [steps, setSteps] = useState([
    { id: 'screener', label: 'Screener survey', length: '5 min' },
    { id: 'consent', label: 'Consent form', length: '2 min' },
    { id: 'interview', label: 'First interview', length: '45 min' },
  ]);
  return (
    <SortableList
      aria-label="Study steps"
      value={steps}
      onReorder={setSteps}
      renderItem={(step) => (
        <span className="flex items-center gap-2">
          <span className="min-w-0 flex-1 truncate">{step.label}</span>
          <span className="text-muted-foreground">{step.length}</span>
        </span>
      )}
    />
  );
}
  • Fits: list, settings: collection (order: user).
  • height, width, padding, gap, corner, background, shadow, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
value?readonly T[]The rows in their order, held in your state (with onReorder).
defaultValue?readonly T[]The rows' first order, the list holding it from there.
onReorder?(next: T[], move: SortableListMove<T>) => voidCalled after each drop that moved a row: the new order and the move.
renderItem?(item: T, state: SortableListRowState) => ReactNodeA row's content after its handle; the item's label in the row's words when left out.
itemLabel?(item: T) => stringA row's name, said as it moves and on its handle (default: its label, else its id).
messages?Partial<SortableListMessages<T>>Your words for what is said while a row moves and for its handle.
disabled?boolean = falseNo row may move.
aria-label?stringThe list's name (Study steps), or aria-labelledby.
aria-labelledby?string
  • Types: SortableListMove = { item: T; from: number; to: number }; SortableListRowState = { index: number; picked: boolean; dragging: boolean }
  • data-slot values (to select a part by): sortable-list, sortable-list-body, sortable-list-content, sortable-list-handle, sortable-list-item, sortable-list-overlay, sortable-list-row, sortable-list-status

Keyboard

KeyWhat it does
TabMove to the next row's handle (each row's handle is its one tab stop; a picked-up row is put back first)
ArrowUp ArrowDownAt rest, move the focus to the handle above or below, past a disabled one; picked up, move the row one place
Home EndAt rest, move the focus to the first or last handle; picked up, move the row to the top or the foot
Space EnterPick the focused row up; again, drop it where it stands (said in the live region, onReorder called)
EscapePicked up or dragged, put every row back where it was, the focus kept on the row's handle; a dialog round the list stays open

Accessibility

  • The part itself answers the keys above.
  • hover, active: the browser's own (:hover, :active): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
draggingthe attribute data-dragging
disabledthe prop disabled

Motion

  • The part sets its own motion: add no transition or animation of your own.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/meadow/components/sortable-list.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-sortable-list.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.