File Upload

A form-associated upload control. The dashed dropzone wraps a real <input type="file">, so the keyboard “Browse” button opens the native picker; drag-and-drop is a progressive enhancement on top.

Install

Examples

Vertical (desktop)

The default vertical layout is a centred dropzone with a large icon. Try dropping or browsing a file to see the sc-file-upload-item rows appear.

Horizontal (compact)

layout="horizontal" packs the icon and browse line into a single row for tighter spaces.

Multiple & accept

multiple keeps every selected file; accept mirrors the native filter; and secondary-text sets the helper line.

Max size

max-size (bytes) flags files that are too large as a negative row instead of accepting them.

Disabled

File rows (sc-file-upload-item)

The component renders these rows for you, but you can use them standalone when wiring a real upload. state drives the visual, and value is the upload percentage.

Guidelines

Usage

document and image uploads in forms. Selected files render as sc-file-upload-item rows that show progress and flag over-size files.

Do

  • State accepted formats and the size limit in secondary-text up front.
  • Set accept and max-size so invalid files are caught early.
  • Use multiple only when several files are genuinely expected.

Don’t

  • Don’t rely on drag-and-drop alone — the Browse button is the accessible path.
  • Don’t hide upload progress or failure; let the file rows carry it.
  • Don’t accept files you can’t process — filter with accept rather than rejecting after upload.

Accessibility

Properties

Related