- Slots
-
prefix— Renders content before the input. -
suffix— Renders content after input. -
helper-text— Renders content below the input. -
file-selector-text— Renders content for the browse button when input type is file. -
file-missing-text— Renders content when input type is file and no file is chosen. -
value-missing— Renders content when the required validation fails. -
custom-error— Renders content when setCustomValidity(message) is set. -
invalid— Renders content when the component is in invalid state (validity.valid = false).
- CSS Parts
-
container— The main wrapper that holds all main input elements. -
input— The native input element. -
label— The native label element. -
file-names— The file names wrapper when input type is 'file'. -
file-selector-button— The browse button when input type is 'file'. -
prefix— The prefix wrapper. -
suffix— The suffix wrapper. -
helper-text— The helper text wrapper.
Properties
Section titled "Properties"accept
Section titled "accept"The file types the control accepts, as a comma-separated list.
accept: string autofocus
Section titled "autofocus"Whether the control should receive focus automatically.
autofocus: boolean multiple
Section titled "multiple"Whether the control allows the user to select more than one file.
multiple: boolean value
Section titled "value"The value of the control. Similar to native file input, this property is read-only and cannot be set programmatically.
value: string Accessors
Section titled "Accessors"files
Section titled "files"Returns the list of selected files.
get files(): FileList
Returns FileList
Events
Section titled "Events"onCancel
Section titled "onCancel"Emitted when the control's file picker dialog is canceled.
onCancel(args: CustomEvent<FileList>): void Parameters
- args:
CustomEvent<FileList>
Returns void
onChange
Section titled "onChange"Emitted when the selection of the control changes.
onChange(args: CustomEvent<FileList>): void Parameters
- args:
CustomEvent<FileList>