FileInput
@stellaria/nebula-webFileInputPropsPreview
Props
23| Prop | Type | Default |
|---|---|---|
accept | string | — |
browseLabel | string | — |
capture | "user" | "environment" | — |
className | string | — |
clearable | boolean | true |
clearLabel | string | "Remove files" |
defaultValue | readonly File[] | — |
description | ReactNode | — |
disabled | boolean | false |
error | string | boolean | — |
errorDisplay | ErrorDisplay | "tooltip" |
field | NebulaField<File[]> | — |
formatValue | ((files: readonly File[]) => ReactNode) | — |
label | ReactNode | — |
multiple | boolean | false |
name | string | — |
onChange | ((value: File[]) => void) | — |
placeholder | string | "No file selected" |
required | boolean | false |
rootClassName | string | — |
size | Size | "md" |
surface | FieldSurface | "outline" |
value | readonly File[] | — |
Slot props
7Each 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 | — |
labelProps The field label. It lands on the `<label>`, which already carries the control `htmlFor`. | TextSlotProps | — |
requiredProps The required asterisk, which lives inside the label. Only rendered with `required`. | BoxSlotProps | — |
triggerProps The button that opens the file browser and shows the chosen files. The native `input` has no slot: it is hidden, and everything it accepts — `accept`, `multiple`, `capture`, `name` — is already a prop. | Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | — |
Also accepts
On top of its own props, this component forwards these groups.