Drop refuse (Pro)
ProIncluded in $99Saying no to a file without a dialog: it shakes its head and is tossed back out, with the reason.
On this page
ProA 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.
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
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
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.