File input

Segmented native file picker with filename field, browse, and optional clear.

Examples

Properties

PropertyAttributeDescriptionType nameTypeDefault
invalidinvalidInvalid chrome on the segmented control.booleanbooleanfalse
readonlyreadonlyHides browse/clear and makes the filename field read-only.booleanboolean—
disableddisabledDisables all controls in the composite.booleanbooleanfalse
labelFilelabel-fileLeft segment label (default `File`).stringstring"File"
labelBrowselabel-browseBrowse control label (default `Browse`).stringstring"Browse"
labelClearlabel-clearClear button label (default `Clear`).stringstring"Clear"
acceptacceptPassed to the native file input.stringstring""
namenameForm-associated name; participates in form submission when a file is set.stringstring""
placeholderplaceholderPlaceholder on the filename text field.stringstring""
ariaLabelaria-labelOptional accessible name for the group.stringstring""
ariaLabelledbyaria-labelledbyOptional id reference for the group label (often the field label element).stringstring""
ariaDescribedbyaria-describedbyOptional hint or error ids.stringstring""
readOnlyreadOnly—booleanbooleanfalse
fileNamefileNameDisplayed filename; editable when not `readOnly`.stringstring""

Methods

Method nameParametersDescription
formResetCallback() => voidN/A—

Usage

File input combines a visible filename, browse trigger, and optional clear control for single-file uploads. It works inside duo-field for labels, hints, and validation.

Do

  • Wrap in duo-field when you need a visible label, description, or error text.
  • Mirror invalid and disabled on the field when this control is a direct slotted child.
  • Provide aria-label, aria-labelledby, or aria-describedby on the host when the field label is not enough context.

Don’t

  • Don’t use for drag-and-drop zones or multi-file pickers without extending the pattern.
  • Don’t duplicate field labels on both duo-field and the file input when the field already labels the control.

Events

The host fires a bubbling, composed input event as CustomEvent<DuoFileInputState> after each user-driven update.