# Recommendation Card

A suggestion from an agent with its confidence, the action to take and the alternatives.

A suggestion from the agent with its confidence, the action to take and the alternatives it weighed. The card holds its shape: every option's body shares one cell, so switching crossfades in place. Alternatives reveals a drawer of the other options, picking one promotes it, and the primary action confirms and turns into Accepted.

Kind: block · Category: Agent · Status: beta · Targets: React, Vue, Svelte

## Add

```bash
npx fndn add recommendation-card
```

It writes the folder `recommendation-card/` into the project's ui folder (`index.ts`, `recommendation-card.tsx`, `RecommendationCard.vue`, `RecommendationCard.svelte`, `recommendation-card.recipe.ts`), and what it is built from: [Button](/components/button.md), [Collapsible](/components/collapsible.md), [Entity Chip](/components/entity-chip.md), [Value Pill](/components/value-pill.md). First time: [Installation](/installation.md).

## Usage

```tsx
import { RecommendationCard } from "@/components/ui/recommendation-card";
```

```vue
import { RecommendationCard } from "@/components/ui/recommendation-card";
```

```svelte
import { RecommendationCard } from "$lib/components/ui/recommendation-card";
```

## Parts

In the DOM the root carries `data-slot="recommendation-card"` and each part `data-slot="recommendation-card-<part>"`; in the recipe the root is the `base` slot and each part a slot named after it in camelCase.

| Part | Element | data-slot | Flags | Notes |
| --- | --- | --- | --- | --- |
| `root` | `div` | `recommendation-card` |  | The root of a collapsible (Zag): data-state=open\|closed from the engine |
| `status` | `span` | `recommendation-card-status` |  | role=status, sr-only; says the accepted label once accepted |
| `body` | `div` | `recommendation-card-body` |  |  |
| `title` | `span` | `recommendation-card-title` |  |  |
| `texts` | `div` | `recommendation-card-texts` |  | one grid cell holding every option's body, so the card is as tall as the longest |
| `text` | `p` | `recommendation-card-text` | repeats | one option's body; data-active on the shown one, aria-hidden on the rest; may contain EntityChip / ValuePill |
| `strong` | `span` | `recommendation-card-strong` | optional |  |
| `drawer` | `div` | `recommendation-card-drawer` | optional | The collapsible’s region (collapsible-content > collapsible-body, the reveal recipe), marked data-recommendation-card="drawer": hidden while closed, instant from the keyboard. Absent with one option |
| `drawer-list` | `div` | `recommendation-card-drawer-list` |  |  |
| `highlight` | `span` | `recommendation-card-highlight` | optional | the alternatives' one glide layer (`glideLayer` of `lib/glide.ts`), first child of the drawer list, aria-hidden; follows hover and focus |
| `drawer-label` | `p` | `recommendation-card-drawer-label` |  |  |
| `alt` | `button` | `recommendation-card-alt` | repeats | one per option; the active option's row is hidden |
| `alt-short` | `span` | `recommendation-card-alt-short` |  | truncates at the end |
| `alt-label` | `span` | `recommendation-card-alt-label` |  |  |
| `meter` | `span` | `recommendation-card-meter` |  | 3 bars on one baseline; data-tone; aria-hidden (the label says it) |
| `meter-bar` | `span` | `recommendation-card-meter-bar` | repeats | data-on when lit |
| `footer` | `div` | `recommendation-card-footer` |  |  |
| `confidence` | `span` | `recommendation-card-confidence` |  |  |
| `confidence-label` | `span` | `recommendation-card-confidence-label` |  |  |
| `actions` | `span` | `recommendation-card-actions` |  | An outline sm Button, Alternatives (the collapsible's trigger: aria-expanded, aria-controls; absent with one option) + the option's primary action |

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title` | `string` |  |  |
| `options` | `{ key: string; body: string \| segment[] (string, { entity, color? }, { value, tone? }, { strong }); short: string; signal: 0 \| 1 \| 2 \| 3; tone: green \| orange \| red \| accent \| neutral; label: string; cta: string; ctaVariant: accent \| primary }[]` |  | The options; with one option there is no Alternatives button and no drawer. |
| `selected` | `number` | `0` | Bindable (React: `defaultSelected` and `onSelectedChange`; Vue: `v-model:selected`; Svelte: `bind:selected`).  |
| `open` | `boolean` | `false` | Bindable (React: `defaultOpen` and `onOpenChange`; Vue: `v-model:open`; Svelte: `bind:open`). The drawer is open (ignored with one option). |
| `accepted` | `boolean` | `false` | Bindable (React: `defaultAccepted` and `onAcceptedChange`; Vue: `v-model:accepted`; Svelte: `bind:accepted`).  |
| `tone` | `"neutral" \| "green" \| "orange" \| "red" \| "accent"` | `"neutral"` | Per option. |
| `labels` | `object` |  | { alternatives, otherOptions, accepted } |

Other attributes and `class` go to the root; `class` is merged through the recipe.

## Events

| Event | Payload |
| --- | --- |
| `accept` | (option) |
| `select` | (index) |
| `openChange` | (open) |

## States

`drawer-open`, `alt-hover`, `alt-press`, `focus-visible`, `selected`, `accepted`

## Keyboard and accessibility

Keyboard:

- Alternatives: Enter / Space toggle the drawer at once; focus stays on the button (aria-expanded, aria-controls)
- The drawer sits above the footer, so its rows come before Alternatives in the tab order (Shift+Tab from Alternatives reaches them)
- Each alternative is a button: Enter / Space promote it; focus stays at the same place in the list
- The primary action: Enter / Space accept

Notes:

- The closed drawer is hidden, so its rows are not in the tab order. With one option there is no Alternatives button and no drawer.
- Inactive bodies are aria-hidden; the meter is aria-hidden next to its text label.
- Accepting announces the accepted label through role=status.

## Motion

- body: crossfade between options, opacity + blur(2px) over duration.base (transition, so rapid picks retarget; the stacked cell keeps the height)
- drawer: the collapsible's reveal recipe (grid-template-rows over duration.reveal easing.out-strong, opacity over duration.base); the footer moves with it; instant from the keyboard
- meter bars: background-color over duration.base
- alt rows: one highlight glides between them on hover and focus (transform + height over duration.move, easing.out-strong; fades in over duration.base); :active hover-2 over duration.fast
- primary action: the button's own colour transition into success

## Tokens

`color.surface`, `color.ink`, `color.ink-2`, `color.ink-3`, `color.line`, `color.line-strong`, `color.hover`, `color.hover-2`, `color.green`, `color.orange`, `color.red`, `color.accent`, `shadow.card`, `radius.card`, `radius.control`, `radius.pill`, `text.2xs`, `text.sm`, `text.md`, `duration.fast`, `duration.base`, `duration.move`, `easing.out-strong`

## Dependencies

- [Button](/components/button.md)
- [Collapsible](/components/collapsible.md)
- [Entity Chip](/components/entity-chip.md)
- [Value Pill](/components/value-pill.md)

## Examples

### Roll back a slow deploy

React · `default.tsx`

```tsx
import type { ComponentProps } from "react";
import { RecommendationCard } from "@/components/ui/recommendation-card";

type Props = ComponentProps<typeof RecommendationCard>;

const options: Props["options"] = [
  {
    key: "rollback",
    body: [
      "Roll back ",
      { entity: "harbor/api" },
      " to ",
      { value: "v2.41.3" },
      ", the last release with p95 under ",
      { value: "180 ms", tone: "green" },
      ".",
    ],
    short: "Roll back to v2.41.3",
    signal: 3,
    tone: "green",
    label: "High confidence",
    cta: "Roll back",
    ctaVariant: "accent",
  },
  {
    key: "scale",
    body: [
      "Keep the release and scale the bookings workers from ",
      { value: "6" },
      " to ",
      { value: "12 instances", tone: "orange" },
      ".",
    ],
    short: "Scale bookings workers to 12",
    signal: 2,
    tone: "orange",
    label: "Needs review",
    cta: "Configure",
    ctaVariant: "primary",
  },
  {
    key: "incident",
    body: [
      "Leave it running and ",
      { strong: "open an incident" },
      " for Maya Chen to triage.",
    ],
    short: "Open an incident for Maya Chen",
    signal: 1,
    tone: "neutral",
    label: "Low confidence",
    cta: "Open incident",
    ctaVariant: "primary",
  },
];

export default function Default() {
  return (
    <RecommendationCard
      title="Booking API latency doubled after the 14:02 deploy"
      options={options}
    />
  );
}
```

Vue · `default.vue`

```vue
<script setup lang="ts">
import { RecommendationCard, type RecommendationOption } from "@/components/ui/recommendation-card";

const options: RecommendationOption[] = [
  {
    key: "rollback",
    body: [
      "Roll back ",
      { entity: "harbor/api" },
      " to ",
      { value: "v2.41.3" },
      ", the last release with p95 under ",
      { value: "180 ms", tone: "green" },
      ".",
    ],
    short: "Roll back to v2.41.3",
    signal: 3,
    tone: "green",
    label: "High confidence",
    cta: "Roll back",
    ctaVariant: "accent",
  },
  {
    key: "scale",
    body: [
      "Keep the release and scale the bookings workers from ",
      { value: "6" },
      " to ",
      { value: "12 instances", tone: "orange" },
      ".",
    ],
    short: "Scale bookings workers to 12",
    signal: 2,
    tone: "orange",
    label: "Needs review",
    cta: "Configure",
    ctaVariant: "primary",
  },
  {
    key: "incident",
    body: [
      "Leave it running and ",
      { strong: "open an incident" },
      " for Maya Chen to triage.",
    ],
    short: "Open an incident for Maya Chen",
    signal: 1,
    tone: "neutral",
    label: "Low confidence",
    cta: "Open incident",
    ctaVariant: "primary",
  },
];
</script>

<template>
  <RecommendationCard
    title="Booking API latency doubled after the 14:02 deploy"
    :options="options"
  />
</template>
```

Svelte · `default.svelte`

```svelte
<script lang="ts">
  import { RecommendationCard, type RecommendationOption } from "$lib/components/ui/recommendation-card";

  const options: RecommendationOption[] = [
    {
      key: "rollback",
      body: [
        "Roll back ",
        { entity: "harbor/api" },
        " to ",
        { value: "v2.41.3" },
        ", the last release with p95 under ",
        { value: "180 ms", tone: "green" },
        ".",
      ],
      short: "Roll back to v2.41.3",
      signal: 3,
      tone: "green",
      label: "High confidence",
      cta: "Roll back",
      ctaVariant: "accent",
    },
    {
      key: "scale",
      body: [
        "Keep the release and scale the bookings workers from ",
        { value: "6" },
        " to ",
        { value: "12 instances", tone: "orange" },
        ".",
      ],
      short: "Scale bookings workers to 12",
      signal: 2,
      tone: "orange",
      label: "Needs review",
      cta: "Configure",
      ctaVariant: "primary",
    },
    {
      key: "incident",
      body: [
        "Leave it running and ",
        { strong: "open an incident" },
        " for Maya Chen to triage.",
      ],
      short: "Open an incident for Maya Chen",
      signal: 1,
      tone: "neutral",
      label: "Low confidence",
      cta: "Open incident",
      ctaVariant: "primary",
    },
  ];
</script>

<RecommendationCard
  title="Booking API latency doubled after the 14:02 deploy"
  options={options}
/>
```

### Refund a double charge, other options open

React · `alternatives.tsx`

```tsx
import type { ComponentProps } from "react";
import { RecommendationCard } from "@/components/ui/recommendation-card";

type Props = ComponentProps<typeof RecommendationCard>;

const options: Props["options"] = [
  {
    key: "refund",
    body: [
      "Refund ",
      { value: "$1,240.00", tone: "green" },
      " to ",
      { entity: "Kestrel Logistics" },
      " for the duplicate November charge.",
    ],
    short: "Refund $1,240.00 to the card",
    signal: 3,
    tone: "green",
    label: "High confidence",
    cta: "Refund",
    ctaVariant: "accent",
  },
  {
    key: "credit",
    body: [
      "Add a ",
      { value: "$1,240.00" },
      " credit to the December invoice instead of refunding.",
    ],
    short: "Credit the December invoice",
    signal: 2,
    tone: "orange",
    label: "Needs review",
    cta: "Apply credit",
    ctaVariant: "primary",
  },
  {
    key: "ask",
    body: [
      "Hold the refund and ",
      { strong: "ask Daniel Okafor" },
      " to check the Stripe payout first.",
    ],
    short: "Ask Daniel Okafor to check",
    signal: 0,
    tone: "neutral",
    label: "No signal",
    cta: "Send to Daniel",
    ctaVariant: "primary",
  },
];

export default function Alternatives() {
  return (
    <RecommendationCard
      title="Kestrel Logistics was charged twice in November"
      options={options}
      defaultOpen
    />
  );
}
```

Vue · `alternatives.vue`

```vue
<script setup lang="ts">
import { ref } from "vue";
import { RecommendationCard, type RecommendationOption } from "@/components/ui/recommendation-card";

const options: RecommendationOption[] = [
  {
    key: "refund",
    body: [
      "Refund ",
      { value: "$1,240.00", tone: "green" },
      " to ",
      { entity: "Kestrel Logistics" },
      " for the duplicate November charge.",
    ],
    short: "Refund $1,240.00 to the card",
    signal: 3,
    tone: "green",
    label: "High confidence",
    cta: "Refund",
    ctaVariant: "accent",
  },
  {
    key: "credit",
    body: [
      "Add a ",
      { value: "$1,240.00" },
      " credit to the December invoice instead of refunding.",
    ],
    short: "Credit the December invoice",
    signal: 2,
    tone: "orange",
    label: "Needs review",
    cta: "Apply credit",
    ctaVariant: "primary",
  },
  {
    key: "ask",
    body: [
      "Hold the refund and ",
      { strong: "ask Daniel Okafor" },
      " to check the Stripe payout first.",
    ],
    short: "Ask Daniel Okafor to check",
    signal: 0,
    tone: "neutral",
    label: "No signal",
    cta: "Send to Daniel",
    ctaVariant: "primary",
  },
];

const open = ref(true);
</script>

<template>
  <RecommendationCard
    title="Kestrel Logistics was charged twice in November"
    :options="options"
    v-model:open="open"
  />
</template>
```

Svelte · `alternatives.svelte`

```svelte
<script lang="ts">
  import { RecommendationCard, type RecommendationOption } from "$lib/components/ui/recommendation-card";

  const options: RecommendationOption[] = [
    {
      key: "refund",
      body: [
        "Refund ",
        { value: "$1,240.00", tone: "green" },
        " to ",
        { entity: "Kestrel Logistics" },
        " for the duplicate November charge.",
      ],
      short: "Refund $1,240.00 to the card",
      signal: 3,
      tone: "green",
      label: "High confidence",
      cta: "Refund",
      ctaVariant: "accent",
    },
    {
      key: "credit",
      body: [
        "Add a ",
        { value: "$1,240.00" },
        " credit to the December invoice instead of refunding.",
      ],
      short: "Credit the December invoice",
      signal: 2,
      tone: "orange",
      label: "Needs review",
      cta: "Apply credit",
      ctaVariant: "primary",
    },
    {
      key: "ask",
      body: [
        "Hold the refund and ",
        { strong: "ask Daniel Okafor" },
        " to check the Stripe payout first.",
      ],
      short: "Ask Daniel Okafor to check",
      signal: 0,
      tone: "neutral",
      label: "No signal",
      cta: "Send to Daniel",
      ctaVariant: "primary",
    },
  ];

  let open = $state(true);
</script>

<RecommendationCard
  title="Kestrel Logistics was charged twice in November"
  options={options}
  bind:open={open}
/>
```

### Credit accepted instead of a refund

React · `accepted.tsx`

```tsx
import type { ComponentProps } from "react";
import { RecommendationCard } from "@/components/ui/recommendation-card";

type Props = ComponentProps<typeof RecommendationCard>;

const options: Props["options"] = [
  {
    key: "refund",
    body: [
      "Refund ",
      { value: "$1,240.00", tone: "green" },
      " to ",
      { entity: "Kestrel Logistics" },
      " for the duplicate November charge.",
    ],
    short: "Refund $1,240.00 to the card",
    signal: 3,
    tone: "green",
    label: "High confidence",
    cta: "Refund",
    ctaVariant: "accent",
  },
  {
    key: "credit",
    body: [
      "Add a ",
      { value: "$1,240.00" },
      " credit to the December invoice instead of refunding.",
    ],
    short: "Credit the December invoice",
    signal: 2,
    tone: "orange",
    label: "Needs review",
    cta: "Apply credit",
    ctaVariant: "primary",
  },
  {
    key: "ask",
    body: [
      "Hold the refund and ",
      { strong: "ask Daniel Okafor" },
      " to check the Stripe payout first.",
    ],
    short: "Ask Daniel Okafor to check",
    signal: 0,
    tone: "neutral",
    label: "No signal",
    cta: "Send to Daniel",
    ctaVariant: "primary",
  },
];

export default function Accepted() {
  return (
    <RecommendationCard
      title="Kestrel Logistics was charged twice in November"
      options={options}
      defaultSelected={1}
      defaultAccepted
    />
  );
}
```

Vue · `accepted.vue`

```vue
<script setup lang="ts">
import { ref } from "vue";
import { RecommendationCard, type RecommendationOption } from "@/components/ui/recommendation-card";

const options: RecommendationOption[] = [
  {
    key: "refund",
    body: [
      "Refund ",
      { value: "$1,240.00", tone: "green" },
      " to ",
      { entity: "Kestrel Logistics" },
      " for the duplicate November charge.",
    ],
    short: "Refund $1,240.00 to the card",
    signal: 3,
    tone: "green",
    label: "High confidence",
    cta: "Refund",
    ctaVariant: "accent",
  },
  {
    key: "credit",
    body: [
      "Add a ",
      { value: "$1,240.00" },
      " credit to the December invoice instead of refunding.",
    ],
    short: "Credit the December invoice",
    signal: 2,
    tone: "orange",
    label: "Needs review",
    cta: "Apply credit",
    ctaVariant: "primary",
  },
  {
    key: "ask",
    body: [
      "Hold the refund and ",
      { strong: "ask Daniel Okafor" },
      " to check the Stripe payout first.",
    ],
    short: "Ask Daniel Okafor to check",
    signal: 0,
    tone: "neutral",
    label: "No signal",
    cta: "Send to Daniel",
    ctaVariant: "primary",
  },
];

const selected = ref(1);

const accepted = ref(true);
</script>

<template>
  <RecommendationCard
    title="Kestrel Logistics was charged twice in November"
    :options="options"
    v-model:selected="selected"
    v-model:accepted="accepted"
  />
</template>
```

Svelte · `accepted.svelte`

```svelte
<script lang="ts">
  import { RecommendationCard, type RecommendationOption } from "$lib/components/ui/recommendation-card";

  const options: RecommendationOption[] = [
    {
      key: "refund",
      body: [
        "Refund ",
        { value: "$1,240.00", tone: "green" },
        " to ",
        { entity: "Kestrel Logistics" },
        " for the duplicate November charge.",
      ],
      short: "Refund $1,240.00 to the card",
      signal: 3,
      tone: "green",
      label: "High confidence",
      cta: "Refund",
      ctaVariant: "accent",
    },
    {
      key: "credit",
      body: [
        "Add a ",
        { value: "$1,240.00" },
        " credit to the December invoice instead of refunding.",
      ],
      short: "Credit the December invoice",
      signal: 2,
      tone: "orange",
      label: "Needs review",
      cta: "Apply credit",
      ctaVariant: "primary",
    },
    {
      key: "ask",
      body: [
        "Hold the refund and ",
        { strong: "ask Daniel Okafor" },
        " to check the Stripe payout first.",
      ],
      short: "Ask Daniel Okafor to check",
      signal: 0,
      tone: "neutral",
      label: "No signal",
      cta: "Send to Daniel",
      ctaVariant: "primary",
    },
  ];

  let selected = $state(1);

  let accepted = $state(true);
</script>

<RecommendationCard
  title="Kestrel Logistics was charged twice in November"
  options={options}
  bind:selected={selected}
  bind:accepted={accepted}
/>
```

### One safe fix, no alternatives

React · `single-option.tsx`

```tsx
import type { ComponentProps } from "react";
import { RecommendationCard } from "@/components/ui/recommendation-card";

type Props = ComponentProps<typeof RecommendationCard>;

const options: Props["options"] = [
  {
    key: "renew",
    body: [
      "Renew the certificate for ",
      { entity: "book.brightlinedental.com" },
      " now; it expires in ",
      { value: "6 days", tone: "red" },
      ".",
    ],
    short: "Renew the certificate now",
    signal: 3,
    tone: "green",
    label: "High confidence",
    cta: "Renew",
    ctaVariant: "accent",
  },
];

export default function SingleOption() {
  return (
    <RecommendationCard
      title="A custom domain certificate is about to expire"
      options={options}
    />
  );
}
```

Vue · `single-option.vue`

```vue
<script setup lang="ts">
import { RecommendationCard, type RecommendationOption } from "@/components/ui/recommendation-card";

const options: RecommendationOption[] = [
  {
    key: "renew",
    body: [
      "Renew the certificate for ",
      { entity: "book.brightlinedental.com" },
      " now; it expires in ",
      { value: "6 days", tone: "red" },
      ".",
    ],
    short: "Renew the certificate now",
    signal: 3,
    tone: "green",
    label: "High confidence",
    cta: "Renew",
    ctaVariant: "accent",
  },
];
</script>

<template>
  <RecommendationCard
    title="A custom domain certificate is about to expire"
    :options="options"
  />
</template>
```

Svelte · `single-option.svelte`

```svelte
<script lang="ts">
  import { RecommendationCard, type RecommendationOption } from "$lib/components/ui/recommendation-card";

  const options: RecommendationOption[] = [
    {
      key: "renew",
      body: [
        "Renew the certificate for ",
        { entity: "book.brightlinedental.com" },
        " now; it expires in ",
        { value: "6 days", tone: "red" },
        ".",
      ],
      short: "Renew the certificate now",
      signal: 3,
      tone: "green",
      label: "High confidence",
      cta: "Renew",
      ctaVariant: "accent",
    },
  ];
</script>

<RecommendationCard
  title="A custom domain certificate is about to expire"
  options={options}
/>
```

## Recipe

`recommendation-card.recipe.ts`:

```ts
import { tv, type VariantProps } from "../lib/tv";
import { glideLayer } from "../lib/glide";

/* recommendation-card — agent suggestion with a confidence meter and actions.
 * The card holds its shape: every option's body is stacked in one grid cell, so the card is as
 * tall as the longest one and switching options crossfades in place (opacity and a 2px blur at
 * duration.base) without moving anything. "Alternatives" reveals a drawer listing the other
 * options (the active one is hidden there); picking one promotes it. The primary action confirms
 * and turns into "Accepted". With one option there is no Alternatives button and no drawer.
 *
 * Composed parts, rendered by the adapter: the card is the root of a collapsible whose trigger is
 * the Alternatives Button and whose region (the collapsible recipe's content and body) is the
 * drawer; bodies hold EntityChips and ValuePills; the actions are Buttons, at text-dense here.
 *
 * Author text takes its direction from its own first letter (plaintext), so an English question
 * in a right-to-left page keeps its question mark at its end; an alternative's name still starts
 * on the page's side. The drawer is the collapsible's content part, marked
 * data-recommendation-card="drawer". The alternatives share one gliding highlight (glideLayer,
 * moved by glide() of lib/glide.ts on hover and focus), as every list of options does. */

export const recommendationCard = tv({
  slots: {
    base: "w-full max-w-[380px] overflow-hidden rounded-card bg-surface shadow-card text-sm",
    status: "sr-only",
    body: "p-3",
    title: "block text-md font-medium text-ink wrap-anywhere [unicode-bidi:plaintext]",
    /* body crossfade: one cell, every option in it; the active one is sharp and opaque */
    texts: "grid mt-1.5",
    text: [
      "[grid-area:1/1] min-w-0 min-h-12 m-0 text-sm leading-[1.625] text-ink-2 wrap-anywhere [unicode-bidi:plaintext]",
      "opacity-0 blur-[2px] motion-opacity-base motion-filter-base",
    ],
    strong: "font-medium text-ink",
    drawer: "",
    /* a distinctly new section of the card */
    drawerList: "relative p-2 border-t border-solid border-t-line bg-surface",
    /* the one hover / focus fill of the alternatives, travelling between them; on the rows' 8px inset */
    highlight: [glideLayer, "inset-x-2 rounded-control"],
    drawerLabel: "m-0 pt-0 pb-1 px-1.5 text-2xs font-medium text-ink-2",
    /* a wrapped name keeps the meter and the label on its first line */
    alt: "relative z-1 flex w-full min-w-0 items-start gap-2.5 p-1.5 rounded-control text-start active:bg-hover-2 motion-colors-fast",
    /* an alternative is a choice: its name wraps rather than being cut */
    altShort: "min-w-0 flex-1 wrap-anywhere text-dense leading-4 text-ink [unicode-bidi:plaintext] [&:dir(ltr)]:text-left [&:dir(rtl)]:text-right",
    altLabel: "shrink-0 text-2xs leading-4 text-ink-2 whitespace-nowrap",
    /* 3-bar confidence meter; the tone colours the lit bars. The bars share one bottom edge and the
     * meter is a fixed 10px box (centred on a 16px line), so meters line up across rows. */
    meter: [
      "[--_tone:var(--fndn-ink-3)] inline-flex shrink-0 h-2.5 my-[3px] items-end gap-0.5",
    ],
    meterBar: "w-1 h-2.5 rounded-pill bg-line-strong motion-colors-base",
    footer: "flex flex-wrap items-center justify-between gap-x-3 gap-y-2 p-2.5 bg-surface",
    /* a long label or action wraps the actions under the confidence instead of squeezing it away */
    confidence: "inline-flex flex-[1_1_96px] min-w-0 items-center gap-2",
    confidenceLabel: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-dense font-medium text-ink-2 [unicode-bidi:plaintext]",
    /* two long actions stack (end-aligned) instead of running past the card */
    actions: "inline-flex flex-wrap justify-end max-w-full min-w-0 items-center gap-2 ms-auto me-[-2px] [&_[data-slot=button]]:text-dense",
  },
  variants: {
    /* the option shown: sharp and opaque */
    active: { true: { text: "opacity-100 filter-none" } },
    /* the meter's tone */
    tone: {
      neutral: {},
      green: { meter: "[--_tone:var(--fndn-green)]" },
      orange: { meter: "[--_tone:var(--fndn-orange)]" },
      red: { meter: "[--_tone:var(--fndn-red)]" },
      accent: { meter: "[--_tone:var(--fndn-accent)]" },
    },
    /* a lit bar */
    on: { true: { meterBar: "bg-[var(--_tone)]" } },
  },
});

export type RecommendationCardRecipeProps = VariantProps<typeof recommendationCard>;
```
