Skip to content
Inputs & Forms

Dropzone

client48.75 kB
@stellaria/nebula-webDropzoneProps

Preview

Props

25
PropTypeDefault

accept

string

className

string

color

ColorExtended"primary"

defaultValue

readonly File[]

description

ReactNode

disabled

booleanfalse

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

booleantrue

name

string

onChange

((files: File[]) => void)

replace

booleanfalse

required

booleanfalse

rootClassName

string

size

Size"md"

value

readonly File[]

withPreview

booleantrue

Slot props

11

Each one spreads over an inner element, so you can restyle a region without forking the component.

PropTypeDefault

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.

Style props · 127