# Training consent

Data use choices at onboarding in plain language, off by default, with a summary of exactly what is shared.

> 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: Training consent. Onboarding asks once, in plain words, with every sharing choice off and a summary that says what is shared. Preview: https://chatcn.dev/preview/training-consent-demo

## Installation

```bash
npx shadcn@latest add @chatcn-pro/training-consent
```

## Usage

```tsx
import { TrainingConsent } from "@/components/ui/chatcn/pro/training-consent"

<TrainingConsent
  choices={[
    { id: "training", title: "Improving the models", description: "Rated chats may be used to train future models.", detail: "…" },
    { id: "history", title: "Chat history", description: "", required: "Needed to show your past chats." },
  ]}
  onConfirm={savePrivacy}
  onLater={skip}
/>
```

Every choice starts off unless you set `defaultOn`; consent defaults to no. Each says in one sentence what turning it on means, and the longer version (who sees what, for how long) is one click away. The summary at the top restates in words exactly what is being shared right now, so the reader never adds up switches. Choices the product cannot work without are shown as Always on with the reason, not as a switch that does nothing. Decide later shares nothing.

## Examples

### States

Example: States. Nothing shared, and two choices on with the summary listing them. Preview: https://chatcn.dev/preview/training-consent-states

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `choices` | `ConsentChoice[]` | `{ id, title, description, detail?, defaultOn?, required? }` |
| `value`, `onValueChange` | `Record<string, boolean>` | Controlled or not |
| `onConfirm`, `onLater` |  | Save, or leave everything off for now |
| `labels` | `Partial<TrainingConsentLabels>` | Every string, for translation |

## Accessibility

- Each switch is named by its title and described by its sentence.
- The summary is a polite live region, so changes are heard.
- Details are disclosure buttons that report their state.

## Motion

Details open with a short rise. Nothing else moves.

Source: https://chatcn.dev/docs/components/training-consent