GitHub

File Input

File upload control with accept filters, multiple files, and size limits.

<rhx-file-input>

Examples

Basic

Images Only

JPG, PNG, or GIF. Max 2MB.

Multiple Files

Max File Size

Maximum file size: 5MB per file

Sizes

States

htmx Integration

PDF, JPG, PNG, or TXT. Max 10MB.
Select a file and click upload...

Properties

Property Type Default Description
name string - The form field name
rhx-label string - Label text
rhx-hint string - Hint text
rhx-accept string - File type filter (e.g. image/*, .pdf)
rhx-multiple bool false Allow multiple file selection
rhx-max-file-size long? - Maximum file size in bytes
rhx-size string medium Input size: small, medium, large
rhx-disabled bool false Whether the file input is disabled

Accessibility

  • Renders a native <input type="file"> element with an associated <label>.
  • Hint text is linked via aria-describedby for screen reader context.
  • The accept filter is announced to assistive technology so users know allowed file types.
  • Disabled state sets aria-disabled="true" on the input.