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 | — |
iconLayoutHow icons align relative to their label. `vertical` stacks icon above label for a tile-style layout. | "horizontal" | "vertical" | "horizontal" |
iconAlignmentHorizontal alignment of the icon within its slot. Only applies when `iconLayout` is `"vertical"`. | "left" | "center" | "left" |
motionOpt-in entrance animation config. Omit for static rendering; pass `{ enabled: true }` (or a preset from `motion.ts`) to animate in on mount. | SocraticMotion | — |