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

NameTypeDefaultDescription
decisionsDecision[]id, title, detail, primary and secondary answer, and collapsed to start folded
onDecide(decision, answer: "primary" | "secondary") => voidCalled when someone picks an answer
classNamestringExtra 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