# Drop refuse

Saying no to a file without a dialog: it shakes its head and is tossed back out, with the reason.

Also called: rejected file, invalid file drop, shake 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: Saying no to a file. A file the composer can't read lands where you dropped it, shakes its head once and is tossed back over the edge, while one line says why and what would work instead. Preview: https://chatcn.dev/preview/drop-refuse-demo

Drop something the composer can't read and the file lands as a card where you let go, shakes its head once, and is tossed back out over the edge, while the composer says why in one line and what would work instead. Files that pass drop in as chips. No modal, no lost text, and the reason is right where you were looking.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/drop-refuse
```

## Usage

```tsx
import { DropRefuse } from "@/components/ui/chatcn/pro/drop-refuse"

<DropRefuse accept={[".png", ".jpg", ".pdf"]} maxSize={20_000_000} attached={files} onFiles={add} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `accept` | `string[]` | Extensions; empty takes anything |
| `maxSize` | `number` | Bytes |
| `onFiles` | `(files: File[]) => void` | Files that passed |
| `attached` | `{ name, size }[]` | Shown as chips |

## Accessibility

- The reason is a polite live region and stays readable for a few seconds; the tossed card is decorative.

## Motion

- One 1.25 s keyframe run: land, shake, toss with a turn. Reduced motion: only the reason shows.

Source: https://chatcn.dev/docs/components/drop-refuse