# Capability card

What the assistant can and cannot do, shown before the first message, with example lines that start the prompt.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: Capability card. A finance assistant sets expectations before the first message; lines with an example start that prompt. Preview: https://chatcn.dev/preview/capability-card-demo

## Installation

```bash
npx shadcn@latest add @chatcn-pro/capability-card
```

## Usage

```tsx
import { CapabilityCard } from "@/components/ui/chatcn/pro/capability-card"

<CapabilityCard
  title="Ledger"
  subtitle="Answers questions about your books."
  can={[{ title: "Draft the monthly report", example: "Draft the October report" }]}
  cannot={[{ title: "Move money or pay bills" }]}
  note="It can be wrong. Check figures before you send them."
  onTry={startChat}
/>
```

Setting expectations before the first answer saves the first bad one. The two lists carry the same weight; the limits are not small print. A line with an `example` becomes a button that starts that prompt, so the card is also the first useful thing to click. The lists stack on a narrow card.

## Examples

### States

Example: States. Only what it can do, and a narrow card where the lists stack. Preview: https://chatcn.dev/preview/capability-card-states

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `title`, `subtitle`, `mark` | `ReactNode` |  |
| `can`, `cannot` | `Capability[]` | `{ title, detail?, example? }` |
| `note` | `ReactNode` | A plain line at the bottom |
| `onTry` | `(example) => void` | Turns lines with an example into buttons |
| `labels` | `Partial<CapabilityCardLabels>` | Every string, for translation |

## Accessibility

- Can and cannot are headed lists, with icons as a second signal.
- Example buttons say what they will ask.

## Motion

None.

Source: https://chatcn.dev/docs/components/capability-card