affectUI › Components › Feedback
Decision Inbox
Open decisions with two quick answers each – answered ones confirm and fold away.
Free and open source (MIT). Install: npx shadcn@latest add https://www.affectui.com/r/decision-inbox.json · Import from @/components/ui/decision-inbox
When to use
- Dashboards or agents that need a quick yes / no from a person before they continue
- Approvals, renewals and alerts that can be answered with one click
When not to use
- Decisions that need a form or a longer explanation – link to a page instead
- Plain notifications without an answer – use a toast or an activity list
Usage
import { DecisionInbox } from "@/components/ui/decision-inbox";
const decisions = [
{
id: "renewal",
title: "Renew Figma for the design team?",
detail: "12 seats · $1,800 per year · renews in 5 days",
primary: "Renew",
secondary: "Change seats",
},
];
export function Inbox() {
return <DecisionInbox decisions={decisions} onDecide={(d, answer) => save(d.id, answer)} />;
}Props
| Name | Type | Default | Description |
|---|---|---|---|
decisions | Decision[] | id, title, detail, primary and secondary answer, and collapsed to start folded | |
onDecide | (decision, answer: "primary" | "secondary") => void | Called when someone picks an answer | |
className | string | Extra class on the tray |
Keyboard
- Tab: Move between the answers and folded decisions
- Enter / Space: Pick an answer or open a folded decision
Accessibility
- The heading with the count is a live region, so the new count is announced
- The confirmation after an answer is a status message; folded-away rows are inert
Responsive
- Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"
Requirements
- React 19
Related
- Change Summary – What moved since last time – one metric per row with a colored trend
- Setup Guide – Onboarding panel with a progress bar and collapsible task groups that strike through when done
Guides
- How to build an agent dashboard in React – The views an AI agent dashboard needs – what's running, who started what, what needs a person, what it cost – and React components for each.
- Human-in-the-loop UI: approvals, permissions and autonomy – UI patterns for keeping people in control of AI agents – approval cards, permission requests, autonomy levels, steering and reviewing changes.
- Approval UI for AI agents: what to show before an agent acts – How to design the approval step for AI agent actions – what the card must show, risk levels, timeouts, batching many requests, and undo after approval.
- Agent UI in React: tasks, progress and human control – Design an agent UI around delegated work: a clear task, visible progress, reviewable actions and a result people can verify.