# Inbox sweep

An approvals inbox that rewards clearing it, once, when you earn it.

Also called: inbox zero, clear inbox.

> 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: An inbox that rewards clearing it. Approved rows sweep out in green while the rest rise; the last one opens to a drawn check, a flick of pen strokes and the day's count. Preview: https://chatcn.dev/preview/inbox-sweep-demo

Approving a row sweeps it out to the side in green while the rows below rise into its place. Approve the last one and the empty inbox opens: a check draws itself, a ring of short pen strokes flicks out round it, and All caught up arrives with the day's count rolling in.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/inbox-sweep
```

## Usage

```tsx
import { InboxSweep } from "@/components/ui/chatcn/pro/inbox-sweep"

<InboxSweep items={pending} onApprove={(id) => approve(id)} approvedToday={count} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `items` | `{ id, title, detail? }[]` |  |
| `onApprove` | `(id: string) => void` | Called after the row has swept out |
| `approvedToday` | `number` | For the empty state |

## Accessibility

- All caught up is a status; each row's button is labelled Approve.

## Motion

- Rows leave in 520 ms; the check draws 420 ms and the strokes flick out once. Reduced motion: rows go at once.

Source: https://chatcn.dev/docs/components/inbox-sweep