Dropzone
@stellaria/nebula-webDropzonePropsPreview
Props
25| Prop | Type | Default |
|---|---|---|
accept | string | — |
className | string | — |
color | ColorExtended | "primary" |
defaultValue | readonly File[] | — |
description | ReactNode | — |
disabled | boolean | false |
error | string | boolean | — |
errorDisplay | ErrorDisplay | "tooltip" |
field | NebulaField<File[]> | — |
height | number | — |
icon | ReactNode | — |
kind | DropzoneKind | "file" |
label | ReactNode | — |
labels | Partial<DropzoneLabels> | — |
maxFiles | number | — |
maxSize | number | — |
multiple | boolean | true |
name | string | — |
onChange | ((files: File[]) => void) | — |
replace | boolean | false |
required | boolean | false |
rootClassName | string | — |
size | Size | "md" |
value | readonly File[] | — |
withPreview | boolean | true |
Slot props
11Each one spreads over an inner element, so you can restyle a region without forking the component.
| Prop | Type | Default |
|---|---|---|
bodyProps Wrapper for the control. | BoxSlotProps | — |
descriptionProps Help text below the label. Only rendered with `description`. | TextSlotProps | — |
errorProps Configures the `FieldError`. With `errorDisplay="tooltip"` it spreads whole; with `"text"` there is no `FieldError` to configure — it is a `Text` with `role="alert"` — and only `className` is honoured. | Omit<FieldErrorProps, "children"> | — |
headerProps The label and description row. Not rendered when the field has neither. | BoxSlotProps | — |
hintProps The hint below the title. | TextSlotProps | — |
iconProps The zone icon. `icon` replaces it whole. | BoxSlotProps | — |
labelProps The field label. It lands on the `<label>`, which already carries the control `htmlFor`. | TextSlotProps | — |
listProps The list of chosen files. Only rendered when there are any. | BoxSlotProps | — |
requiredProps The required asterisk, which lives inside the label. Only rendered with `required`. | BoxSlotProps | — |
titleProps The title, which changes with the drag state. | TextSlotProps | — |
zoneProps The drop zone, which is the button. It carries `data-drag`, which is where its highlight comes from. | Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | — |
Also accepts
On top of its own props, this component forwards these groups.