<orb-file-input
  label="Upload a file!"
  multiple
></orb-file-input>

Properties

accept

Description Comma-separated list of acceptable file types, such as image/* or .pdf
Attribute accept
Type string
Default undefined

capture

Description On mobile devices, which camera to capture from. Only used when accept includes an image, video, or audio type.
Attribute capture
Type "environment" | "user"
Default undefined

disabled

Description Disables the control
Attribute disabled
Type boolean
Default false

files

Description The selected files
Attribute –
Type File[]
Default []

label

Description Label that shows above the control
Attribute label
Type string
Default undefined

multiple

Description Allows more than one file to be selected
Attribute multiple
Type boolean
Default false

name

Description Name the files are submitted under with form data
Attribute name
Type string
Default undefined

note

Description Additional info that shows below the control
Attribute note
Type string
Default undefined

ready

Description A promise that resolves when the component has completed it’s initial render
Attribute –
Type Promise<unknown>
Default new Promise((res) => (this.#resolve = res))

required

Description Requires at least one file before the form can be submitted
Attribute required
Type boolean
Default false

size

Description Size of the control
Attribute size
Type "lg" | "md" | "sm" | "xs"
Default "md"

Events

orbChange

Description Emitted when files are added or removed
Type CustomEvent<void>

orbInput

Description Emitted when files are added or removed
Type CustomEvent<void>

Methods

resetValidity

Description Clears custom errors and the user interaction state, so validation styling is hidden until the user interacts with the control again.
Signature resetValidity() => Promise<void>

setCustomValidity

Description Sets a custom validation error. Pass an empty string to clear it.
Signature setCustomValidity(message: string) => Promise<void>
Parameters message (string)

Shadow Parts

Part Description
"dropzone"
"dropzone-icon"
"dropzone-text"
"file"
"file-details"
"file-icon"
"file-image"
"file-list"
"file-name"
"file-size"
"file-thumbnail"
"remove-button"

Dependencies

Depends on

Graph

graph TD; orb-file-input --> orb-label orb-file-input --> orb-note orb-file-input --> orb-card orb-file-input --> orb-toolbar orb-file-input --> orb-button orb-button --> orb-loading style orb-file-input fill:#f9f,stroke:#333,stroke-width:4px