Priority Rank
Open in playgroundDrag rows to reorder priorities. Items not present in `value` are appended in their natural order, so an empty array starts with the items in their source sequence.
Preview
Usage
import { PriorityRank } from "@/components/socratic-ui/priority-rank";
<PriorityRank
question="Rank what to tackle first"
items={[
{ title: "User research" },
{ title: "Technical architecture" },
]}
value={ranking}
onChange={setRanking}
/>
API Reference
| Prop | Type | Default |
|---|---|---|
questionrequiredThe headline shown above the items. | string | — |
subtitleOptional supporting copy beneath the question. | string | — |
itemsrequiredThe list of rankable items. | { title: string; subtitle?: string }[] | — |
valuerequiredOrdered list of titles, highest priority first. | string[] | — |
onChangerequiredCalled when the user drags an item to a new position. | (value: string[]) => void | — |
numberOptional leading question number. | string | — |