# FileDrop

A Themes-styled drop target and browse control that keep the native file input and accepted file array as the sole selection authority.

```tsx


() => <FileDrop.Root size="2" color="indigo" radius="large" variant="surface" name="attachments" accept=".pdf,image/*" multiple required>

  <FileDrop.Input aria-label="Attachments" />

  <p>Drop files here or browse for attachments.</p>

  <FileDrop.Trigger aria-label="Browse attachments">Browse files</FileDrop.Trigger>

</FileDrop.Root>
```

This wrapper is a native Solid project extension included in published Themes `0.1.0-rc.4`, not an official Radix React component. It preserves the [`FileDrop` Primitives parts and state contract](/primitives/docs/components/file-drop): one Root, exactly one real Input, one Trigger for that input, accepted `readonly File[]`, and the same form and whole-batch UX policy. It adds visual styling, not another chooser, upload service or file-validation boundary.

Select the FileDrop CSS Modules, plain CSS or Tailwind archive from the Themes playground. Each generated archive installs exact published Primitives and Themes versions from npm; no local package tarballs are bundled. Extract the archive, run `pnpm install` and `pnpm build`.

## Styling props

`Root` adds `size` (`1`, `2`, or `3`), `color`, `radius`, and `variant` (`surface`, `soft`, or `outline`). All parts preserve native props and refs. Use one clear accessible name for the Input and a separate accessible name for the Trigger. Keep instructions and rejection messages visible; drag and drop is an enhancement, not the only interaction.

The Root preserves the Primitives drag and disabled styling hooks:

| Attribute         | Value / condition                                                                             |
| ----------------- | --------------------------------------------------------------------------------------------- |
| `[data-dragging]` | `"true"` while Root tracks a file drag; `"false"` otherwise. The attribute is always present. |
| `[data-disabled]` | Present as an empty attribute when Root is disabled; absent otherwise.                        |

The Root's controlled `value` remains the accepted selection. Application-side append, delayed adoption/refusal, and remove-one behavior must be implemented by passing accepted arrays back to the controlled Root. `multiple`, `accept`, `required`, `disabled`, `name`, and external `form` ownership keep the native behavior described in the Primitives reference. An `accept` hint is not security validation; validate uploaded bytes and authorization on your server. The wrapper never uploads or inspects file content.
