Skip to main content

File Upload

Enables users to attach one or more files from their device via drag-and-drop or browse. Use in forms or workflows that require document or media attachment. Don't use without specifying accepted file types and size limits in the helper text.

Figma Storybook Docs

Description

What it does

Allows users to select and attach one or more files from their device, either by dragging files into a drop zone or by clicking to open the system file browser. Displays a list of selected files with their names, sizes, and removal options before final form submission.

Where it appears

Consultation submission forms (attaching supporting documents, images, or reports), stakeholder record management (uploading contact lists or organisation documents), and community engagement workflows where participants submit evidence or media alongside a response.

Why it exists

Government engagement processes frequently require supporting documentation — plans, PDFs, images, spreadsheets — alongside a form response. File upload gives teams a consistent, accessible pattern for collecting attachments without requiring third-party integrations or custom implementations.

Anatomy

PartRequired?Notes
Drop zone container Required The bordered, interactive region users can drag files onto or click to trigger the file browser. Communicates affordance through dashed border styling and a label.
Upload icon Recommended A wa-icon inside the drop zone that reinforces the drag-and-drop affordance. Use the 'cloud-arrow-up' icon from the system icon set.
Primary label Required Short instruction text inside the drop zone, e.g. 'Drag and drop files here, or browse'. Should be concise and action-oriented.
Browse link Required An inline interactive element styled as a link inside the label that triggers the native file picker. Must be keyboard-focusable and labelled for screen readers.
Helper text Required Displayed beneath the drop zone. Must specify accepted file types and maximum file size, e.g. 'Accepted formats: PDF, DOCX, JPG. Maximum 10 MB per file.'
File list Recommended A list of attached files rendered below the drop zone after selection. Each item shows the file name, file size, upload status, and a remove button.
File list item — name Required Truncated file name shown in primary text colour. Full name available via tooltip or wrapping on smaller viewports.
File list item — size Recommended Human-readable file size (e.g. '2.4 MB') rendered in secondary text colour.
File list item — status indicator Recommended Shows upload progress (wa-progress-bar), success (wa-icon check with --op-color-status-success), or error (wa-icon with --op-color-status-error) state per file.
File list item — remove button Required An icon-only button that removes the file from the selection. Must carry an accessible label identifying the file, e.g. 'Remove quarterly-report.pdf'.
Error message Conditional Inline error message rendered when a file fails validation (wrong type, too large). Uses --op-color-status-error tokens.

Variants

Single file

Restricts selection to one file at a time. Replacing a selection swaps the current file.

When the form expects exactly one document, such as a signed consent form or a profile image upload.

Multi-file

Allows multiple files to be selected and listed individually.

When users need to attach several supporting documents at once, such as images of a site, a plan PDF, and a covering letter for a consultation submission.

Image-only

Visually emphasises image upload with an optional thumbnail preview replacing the generic file-name row.

Community engagement submissions asking for photos of a location, event, or issue in Social Point.

States

State Behaviour
Default (empty) Drop zone displays at rest with dashed --op-color-border-default border, upload icon, and label. No files are listed.
Drag-over (active) When a file is dragged over the drop zone, the border colour transitions to --op-color-interactive-default and the background shifts to --op-color-interactive-default at approximately 8% opacity, signalling the zone is ready to accept the drop.
Focused When the drop zone or browse link receives keyboard focus, a 3px focus ring using --op-color-interactive-focus is rendered. The drop zone can be activated with Enter or Space.
Uploading Each file item in the list shows a wa-progress-bar beneath the file name. The remove button remains active so users can cancel mid-upload.
Upload success The progress bar is replaced by a success icon (--op-color-status-success) and an 'Uploaded' label. The remove button remains to allow de-selection before form submission.
File error If a file fails type or size validation, the file list item renders the file name in --op-color-status-error, an error icon, and a short inline error message. The file is not queued for upload.
Disabled The drop zone and browse link are non-interactive. Border and text use --op-color-text-disabled. Helper text should explain why the field is disabled.

Usage guidelines

When to use

  • A form submission requires supporting documentation, such as attaching a consultation submission document alongside a structured form response.
  • Stakeholder management workflows where an admin uploads a CSV of contacts to bulk-import into Open Point.
  • Community engagement submissions where participants are invited to share photos or evidence in Social Point.
  • Any workflow where file size and type constraints need to be enforced before submission reaches the server.

When not to use

  • Do not use file upload as the sole input for a response — always pair it with other form fields so users without a file to attach can still submit. Make the attachment optional where possible.
  • Do not use if the platform or storage backend cannot handle the expected file types or sizes — instead display a clear message directing users to submit files via another channel.
  • Do not use for inline rich-text content embedding; use the rich-text editor's built-in media insert instead.
  • Do not use when a URL link to an external document is sufficient — use a plain text Input with URL validation instead.

Do / Don't

Do

Always state accepted file types and the maximum size limit in the helper text before the user interacts with the field.

Don't

Don't display format restrictions only after a failed upload attempt — this creates unnecessary friction and can prevent submission.

Do

Provide a per-file error message in the file list when validation fails, naming the specific file and the reason for rejection.

Don't

Don't use a single generic error for all files — users with mixed valid/invalid selections need to know which files failed and why.

Do

Keep the remove button accessible and labelled with the file name so screen reader users can identify which file they are removing.

Don't

Don't use a generic 'Remove' label for all remove buttons — this creates ambiguity for assistive technology users.

Do

Allow users to add additional files after an initial selection in multi-file mode.

Don't

Don't replace the entire file list when a user opens the file picker again in multi-file mode — append new selections instead.

Do

Confirm upload success per file with a visible status indicator pairing icon and text.

Don't

Don't silently succeed — users need confirmation that their attachment was received, especially in government submission contexts where evidence of lodgement matters.

Was this page helpful?

Updated 9 September 2026