Recommendation Card
ProNewAgent suggestion card with a segmented confidence meter, impact badges, and Accept/Dismiss actions that fold into a receipt.
Installation
pnpm dlx shadcn@latest add @viewport/recommendation-card
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| title* | stringPrimary action the agent recommends. | — |
| rationale* | stringShort supporting rationale. | — |
| confidence* | numberNumeric confidence between 0 and 100. | — |
| entity | stringOptional entity badge, e.g. "Cone King · 7d lead". | — |
| impact | stringOptional impact tag, e.g. "+$4,200/mo". | — |
| acceptLabel | stringLabel for the accept button. | "Accept" |
| onAccept | () => voidCalled when accepted. | — |
| onDismiss | () => voidCalled when dismissed. | — |
| className | string | — |
Accessibility
- Confidence bar uses role=meter with min, max, and current value.
- Once accepted or dismissed, the decision is announced through a status region.
- Layout folding and segment entrance respect prefers-reduced-motion.