# What's new

A feature announcement shown once per release, one feature at a time, that never comes back after Got it.

> 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: What's new. A release note that opens once per version, one feature at a time. Preview: https://chatcn.dev/preview/whats-new-demo

## Installation

```bash
npx shadcn@latest add @chatcn-pro/whats-new
```

## Usage

```tsx
import { WhatsNew } from "@/components/ui/chatcn/pro/whats-new"

<WhatsNew
  version="November release"
  items={[
    { title: "Agents that run while you are away", body: "…", media: { src: "/agents.webp", alt: "…" } },
    { title: "See where your credits go", body: "…" },
  ]}
/>
```

Opens on its own the first time a reader meets a new `version`, and never again once closed; shipping the next release is all it takes to show the next one. Each page has its picture or short muted clip, a title, why it matters and an optional action. Arrow keys page through it; Got it on the last page or Escape closes it. `WhatsNewCard` is the same content without the dialog, for a changelog page or a panel; with `stack` the pages still to read sit under it as sheets, so there is visibly more to come.

## Examples

### States

Example: States. The first page, the last page with Got it, and a note with no picture. Preview: https://chatcn.dev/preview/whats-new-states

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `version` | `string` | Shown on each page and remembered once seen |
| `items` | `WhatsNewItem[]` | `{ title, body?, media?, action? }` |
| `storageKey` | `string` | Where the seen version is kept |
| `open`, `onOpenChange`, `auto` |  | Controlled, or opens on its own when unseen |
| `index`, `defaultIndex`, `onIndexChange` | `number` | The page |
| `stack` | `boolean` | Card only. Sheets under the card for the pages left, up to two |
| `labels` | `Partial<WhatsNewLabels>` | Every string, for translation |

## Keyboard

| Key | Action |
| --- | --- |
| Right, Left | Next, back (reversed right to left) |
| Escape | Close |

## Accessibility

- A dialog named by the release; focus starts inside and returns on close.
- Clips are muted and stop under reduced motion; pictures have descriptions.
- The page dots are an image labelled with the position.

## Motion

Each page rises in over 220 ms; stacked sheets fade and shrink away in 280 ms as you page. Clips play muted and loop, and do not play under reduced motion.

Source: https://chatcn.dev/docs/components/whats-new