# Dropzone (Lumen Halo): prompt.md (v1.0.0)

- id: `lumen-dropzone` · version 1.0.0 · component · pro (All-Access)
- category: Inputs
- build: Base UI (one set of files; its dependencies follow the build)
- install (this build): `npx shadcn@latest add @beautiful-ui-pro/lumen-dropzone`
- npm dependencies: none
- registry dependencies: utils, https://beautiful-ui.dev/r/lumen-foundation.json
- docs: https://beautiful-ui.dev/components/lumen-dropzone
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

A recessed panel with a faint lattice of cells: drag a file over it and the cells light around your pointer, the outline becomes a lit filament, and it takes the drop with a soft cue, or glows red for files it won't take. Checks type, size and count; pairs with Attachment for each file's upload.

## Build it
- Stack: React 19 (`ref` is a plain prop), TypeScript, Tailwind CSS v4 utilities, a shadcn-initialised project with the `@/*` alias.
- Packages: none beyond React.
- Files: `components/ui/lumen/dropzone.tsx`; shared code: `lib/beautiful-ui/lumen/glyphs.tsx`, `lib/beautiful-ui/lumen/sound.ts`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `lumen-foundation`.
- Builds: one set of files for both, but its dependencies come in Base UI and Radix builds. Install the one that matches the project (see Install): a free item's bare URL installs the Base UI build of it and its dependencies.
- Exports to keep: `Dropzone`, and every exported type.
- CSS: the install merges this item's rules (the registry `css` field) into your global stylesheet, in `@layer components`, and adds the lumen foundation (tokens, keyframes, motion levels) once. Nothing to import by hand.
- Re-running `add` (or `--overwrite`) re-applies those rules: put overrides in your own CSS, never in the installed rules.
- Tokens: retheme with the `--lumen-*` custom properties (`--lumen-accent`, `--lumen-accent-text`, `--lumen-bad`, `--lumen-bad-text`, `--lumen-focus`, `--lumen-good`, `--lumen-good-text`, `--lumen-hairline`, `--lumen-ink`, `--lumen-muted-ink`, `--lumen-series-1`, `--lumen-series-2`, `--lumen-series-3`, `--lumen-series-4`, `--lumen-series-5`, `--lumen-series-6`, `--lumen-warn`, `--lumen-warn-text`); this item's CSS also reads `--lumen-dz-x`, `--lumen-dz-y`, `--lumen-font-mono`, `--lumen-font-sans`, `--lumen-radius-k`. Never add Tailwind colour classes inside the component.

```tsx
import { Dropzone } from "@/components/ui/lumen/dropzone";
```

## Parts

| Part | data-slot | What it is for |
|---|---|---|
| `Dropzone` | `dropzone` | The drop target and picker. |

Style a part with `[data-slot="<slot>"]` selectors or its `className`; keep the attributes when editing.

## Sound
- Keep every `data-slot` and `data-sound` attribute: the sound layer reads them.
- Installing this item adds no audio. Nothing plays until the app mounts `GlassSoundProvider` once (install: `npx shadcn@latest add https://beautiful-ui.dev/r/glass-sound.json`, import from `@/components/beautiful-ui/glass-sound`); `GlassSoundToggle` is its mute control. Without a provider the audio engine never loads.

## Match the original
- Read `components/ui/lumen/dropzone.tsx` as the reference implementation before changing or recreating anything, and match it: sizes, colours per theme, motion timings, copy and behaviour.
- If you deviate (a prop you can't honour, a style you changed, a dependency you swapped), say so in your reply, part by part.
- Keep the accessibility contract, the keyboard map and the motion levels listed below.

## Use it when
- dropzone, file upload, drag and drop upload, file picker, upload area, import CSV, attach files, Lumen
- Uploading files people may drag from the desktop
- Imports: CSVs, images, documents

### Not when
- One small optional file in a dense form: a button with a file input is enough

## Mistakes
- Validate on the server too: accept is a hint the browser can't enforce on drop
- Show each file's progress (Attachment) after the drop

## Usage

```tsx
import { Dropzone } from "@/components/ui/lumen/dropzone";

<Dropzone accept="image/*,.pdf" maxSize={10 * 1024 * 1024} onFilesAccepted={(files) => upload(files)} onFilesRejected={(r) => toast.error(`${r.length} files skipped`)} />
```

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `accept` | `string` |  | Like input accept: "image/*,.pdf". |
| `maxSize` | `number` |  | Largest file in bytes. |
| `maxFiles` | `number` |  | Most files per drop. |
| `multiple` | `boolean` | `true` | Allow several files. |
| `onFilesAccepted` | `(files: File[]) => void` |  | Files that passed. |
| `onFilesRejected` | `(rejections: { file: File; reason: "type" \| "size" \| "count" }[]) => void` |  | Files that didn't, and why. |
| `title / hint` | `ReactNode` |  | The words; the hint defaults to what it accepts. |
| `disabled` | `boolean` | `false` | Stop taking files. |

Full docs: https://beautiful-ui.dev/components/lumen-dropzone

## Customising
- Colours: set the `--lumen-*` tokens on `:root`, or on a container with the `lumen-scope` class to retheme one area. Add the `lumen-inherit` class to follow your shadcn palette instead (`--chart-N`, `--destructive`).
- Dark mode follows the `.dark` class on an ancestor (the shadcn and next-themes convention).
- Update later by re-running the install with `--overwrite` (review the diff if you edited it). Changelog: https://beautiful-ui.dev/r/changelog.json

## Keyboard

| Keys | Action |
|---|---|
| Enter / Space | Open the file picker |

## Motion inventory

| Interaction | What moves |
|---|---|
| Drag over | Cells light around the pointer; the outline becomes a filament; the cell lifts |
| Won't take it | The same, in red, without the lift |

## Accessibility contract (preserve when editing)
- A focusable button that opens the file picker
- The hint (types, size, count) is its description
- Tell people about rejections in words (a Toast or field error), not only the red glow

## Install

```bash
npx shadcn@latest add @beautiful-ui-pro/lumen-dropzone
```

Pro item: needs the `@beautiful-ui-pro` registry in `components.json` and `BEAUTIFUL_UI_TOKEN` in `.env.local` (https://beautiful-ui.dev/account). Setup: https://beautiful-ui.dev/docs/pro. Your components.json `style` picks the build: radix-*, new-york and default get Radix, base-* gets Base UI.

## Credits
- Built on shadcn/ui conventions (https://ui.shadcn.com)

The lumen foundation (the tokens listed above, keyframes and motion levels) installs once with the first component; its CSS is public at https://beautiful-ui.dev/r/lumen-foundation.json.
