# File dropzone

Takes one file, by a click or by drag and drop, such as a CV.

This is the HTML to build it with `dex.css`, for work outside the Dex codebase. Read https://brand.meetdex.ai/design.md first: it says how to set up a page and how to use the stylesheet. The page at https://brand.meetdex.ai/components/file-dropzone shows the Dex app's own React component, which only works inside the Dex codebase.

## HTML

A `<label>` round a hidden file input, so a click anywhere opens the picker. Every state is the same 120px box.

```html
<label class="dex-dropzone">
  <input type="file" accept=".pdf,.docx" />
  <svg aria-hidden="true"><!-- Lucide upload --></svg>
  <span>
    <span style="display: block">Upload your CV</span>
    <span class="dex-muted" style="display: block">PDF or DOCX, up to 10 MB</span>
  </span>
</label>
```

- **Uploading**: the same box with `role="status"`, a spinning Lucide `loader-circle` and "Uploading…" with the file name under it in `dex-muted`. No percentage: nothing reports progress. `dex.css` has no spin; add `animation` of your own if the mock moves.
- **Uploaded**: `dex-dropzone dex-dropzone--done`, a Lucide `circle-check-big` and the file name with its size in `dex-muted`.

```html
<div class="dex-dropzone dex-dropzone--done">
  <svg aria-hidden="true"><!-- Lucide circle-check-big --></svg>
  <span>pete-randall-cv.pdf <span class="dex-muted">· 182 KB</span></span>
</div>
```

- **With remove**: a ghost icon button with `aria-label="Remove file"` and a Lucide `x`, at the box's top right (place it with your own `position: absolute`).
- **Invalid**: `aria-invalid="true"` on the input turns the dashed edge red, with a `dex-field-error` 8px below: "Upload a PDF or DOCX under 10 MB."
- **Disabled**: `disabled` on the input fades the box.

## States

- Hover and a file dragged over: the 50% edge and a muted fill. Keyboard focus on the hidden input: the 75% edge.

## Rules

- Say what's accepted in the box ("PDF or DOCX, up to 10 MB").
- Check the file's size and type yourself: `accept` only filters the picker, and a dropped file can be anything.
- Keep the box the same size in every state, so the form below doesn't move.
- Give the input an id unique on the page if a separate label points at it.
