File Dropzone
Drag-and-drop file upload area.
Import
tsx
import { FileDropzone } from "@cronus-ui/ui";
bash
npx cronus-ui add file-dropzone
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component FileDropzoneDefault layout:inline style:file-dropzone {
aria-label:"Upload files"
label "Upload files"
}
page "/audit/file-dropzone/default" type:custom {
use FileDropzoneDefault
}
API Reference
Generated from the component's exported types.
FileDropzoneLabels
| Prop | Type | Default | Description |
|---|---|---|---|
upload* | string | — | — |
drop* | string | — | — |
browse* | string | — | — |
FileDropzoneProps
| Prop | Type | Default | Description |
|---|---|---|---|
onFiles* | (files: File[]) => void | — | — |
accept | string | — | — |
multiple | boolean | false | — |
disabled | boolean | false | Disables pointer and keyboard interaction. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
aria-label | string | — | Accessible name for the file input. Defaults to `"Upload files"` so the control is never nameless. |
aria-describedby | string | — | IDs of element(s) that describe the dropzone (e.g. accepted types). |
labels | Partial<FileDropzoneLabels> | — | Override the default English strings. |