# Task dock

A long task you can put away: the card shrinks into a dock tab that keeps its progress.

Also called: minimize task, minimize animation.

> 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: Put a task away. Minimise the render and the card shrinks into a small tab at the dock that keeps the progress as a ring; click it and the card grows back. Preview: https://chatcn.dev/preview/task-dock-demo

Minimise the card and it shrinks into a small tab at the dock, travelling to where the tab sits and taking its shape on the way. The tab keeps the progress as a ring and the task's short name. Click the tab and the card grows back out of it. If the task finishes while docked, the ring becomes a check.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/task-dock
```

## Usage

```tsx
import { TaskDock } from "@/components/ui/chatcn/pro/task-dock"

<TaskDock task={{ title, short: "Video", progress, status }} docked={docked} onDockedChange={setDocked}>
  <Preview />
</TaskDock>
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `task` | `{ title, short?, detail?, progress, status }` |  |
| `docked` / `onDockedChange` | `boolean` |  |
| `children` | `ReactNode` | Under the card's header |

## Accessibility

- The hidden card is inert; the tab is a button named with the task and its progress.

## Motion

- One 420 ms transform from card to tab and back, its corners following. Reduced motion: it swaps.

Source: https://chatcn.dev/docs/components/task-dock