# RecommendationCard

> An agent's proposal awaiting an answer: a kicker, the recommendation, a confidence figure counted up beside a ring that fills to match, and two buttons that collapse into one quiet resolved line.

- Package: `fancy-ui-react` (React 18/19 + Tailwind CSS v4)
- Category: AI Agents
- Tags: ai, agents, recommendation, confidence
- Dependencies: number-ticker
- Types: `RecommendationCardProps`, `RecommendationState`
- Docs: https://fancy-ui.rama.app/docs/components/recommendation-card
- Source: https://github.com/RamaHerbin/fancy-ui/tree/main/react/src/components/recommendation-card

## Import

```tsx
import { RecommendationCard } from 'fancy-ui-react';
```

Setup (once per project): `npm install fancy-ui-react`, then put these lines in your main CSS file (the stylesheet import goes right after `@import "tailwindcss";`):

```css
@import "tailwindcss";
@import "fancy-ui-react/tailwind.css";
```

and import the component styles once in the app entry: `import "fancy-ui-react/styles.css";`. Full guide: https://fancy-ui.rama.app/llms.txt

The names below are the ones to write in React; when one differs from the Svelte name, the Svelte name follows in parentheses. `class` becomes `className`, a callback takes the name the React port declares (`onclick` becomes `onClick`), snippets become `ReactNode` props (render functions when they take arguments) and the default snippet is `children`. Divergences: https://github.com/RamaHerbin/fancy-ui/tree/main/react#divergences-from-the-svelte-api

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title` (required) | `string` | — | What the agent is proposing, e.g. "Add an index on orders.customer_id" |
| `description` | `string` | — | Secondary muted line under the title — the reasoning, the expected effect |
| `confidence` | `number` | — | How sure the agent is, from 0 to 1. Omitted, the whole confidence block disappears rather than reading as zero; out-of-range numbers are clamped and the band shifts colour at 0.75 and 0.5 |
| `acceptLabel` | `string` | `"Apply"` | Label for the confirm button |
| `dismissLabel` | `string` | `"Dismiss"` | Label for the decline button |
| `onAccept` | `() => void` | — | Called when the recommendation is accepted, after `state` has been written |
| `onDismiss` | `() => void` | — | Called when the recommendation is dismissed, after `state` has been written |
| `state` | `"open" \| "accepted" \| "dismissed"` | `"open"` | Where the recommendation stands (bindable). Resolving swaps the buttons for a quiet line inside a polite live region; a resolved card refuses to resolve again |
| `badge` | `string` | — | Small kicker above the title, e.g. "Suggestion" |
| `sound` | `boolean` | `false` | Plays select on accept and close on dismiss, once the user has enabled sound |

## Node props

| Prop | Description |
| --- | --- |
| `children` | The detail region between the header and the footer — a snippet of the change being proposed |

## Example

No React example is published for this component yet: start from the import above and the props table. The full examples are Svelte-only, on https://fancy-ui.rama.app/docs/components/recommendation-card.md.
