A yes or a no, and then the answer
Decision row is one item waiting on the reader: a request, an invitation, a draft, a change to review. While it waits it offers two buttons in your words, and once decided it settles to a mark saying which, with Undo while you can still reverse it. It is a Widget row with that lifecycle, so it sits in a Widget beside plain rows. When the buttons leave, focus moves to Undo or to the row, and the outcome is announced.
A queue
In your own words
Alternatives
- Use Action card instead when an assistant proposes the change in a chat reply.
- Use Widget instead when the rows only report or link, with no decision to take.
Props
Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.
| Prop | Type | Default | Description |
|---|---|---|---|
title* | string | What is waiting on a decision: who asked and for what. Collides with the native `title` tooltip attribute on purpose: the row shows it. | |
description | string | A quiet second line: the dates, the amount, the reason given. | |
leading | ReactNode | A leading mark: an Avatar, a StatusDot, an icon. Decorative unless the element names itself. | |
meta | ReactNode | A trailing fact before the decision: when it was asked, how long it has waited. | |
status | DecisionRowStatus | "pending" | Where the decision stands, for controlled use. Pair with `onStatusChange`. Unset, the row keeps its own, starting at `defaultStatus`. |
defaultStatus | DecisionRowStatus | 'pending' | Where it stands to begin with, for uncontrolled use. |
onStatusChange | ((status: DecisionRowStatus) => void) | Fires with the new status when the reader accepts, declines or undoes. | |
onAccept | (() => void) | Fires when the reader accepts. | |
onDecline | (() => void) | Fires when the reader declines. | |
onUndo | (() => void) | Offers Undo on a settled row, which returns it to pending and fires this. Leave it unset where a decision cannot be reversed. | |
tone | "default" | "destructive" | 'default' | The accept button's colour: `destructive` for a decision whose yes takes something away (remove a member, delete a draft), as ActionCard's `tone` does for a change. |
acceptLabel | string | 'Accept' | The accept button's words. |
declineLabel | string | 'Decline' | The decline button's words. |
acceptedLabel | string | 'Accepted' | The settled mark's words once accepted. |
declinedLabel | string | 'Declined' | The settled mark's words once declined. |
undoLabel | string | 'Undo' | The undo button's words. |
settledAnnouncement | ((title: string, outcome: string) => string) | (rowTitle, outcome) => `${outcome}: ${rowTitle}` | What is announced when the row settles, given its title and the settled mark's words: "Accepted: Room booking". |
className | string | '' | Additional CSS classes |
ref | Ref<HTMLDivElement> | A ref onto the row's root `<div>`. |
Tested keys
An automated test presses every row below, in a left-to-right and a right-to-left layout.
The buttons follows the WAI-ARIA button pattern.
| Key | What it does |
|---|---|
Enter | Activates the button. |
Space | Activates the button. |
// From the npm package
import { DecisionRow } from 'rift-ds/components/DecisionRow/DecisionRow';
// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/decision-row.json3.8 kB gzipped, with everything it imports. Peer dependencies are not counted.
For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.