Skip to main content
Coat of arms of Barbados
Official government website

File Upload

Lets users attach a file, such as a supporting document.

Preview

File upload with an uploaded file

The File Upload component lets users attach a file, such as a supporting document or a photo of an ID. The whole dropzone acts as the label, so clicking anywhere inside it opens the file picker, and uploaded files stay visible in a list so users can confirm what they attached.

When to use this component

Use file upload when you genuinely need a copy of a document that cannot be verified another way, such as evidence of address or a scanned certificate.

When not to use this component

Do not ask users to upload a file when the information could instead be entered as text, looked up from another government system, or confirmed by a simple declaration. Every upload is extra work and a chance to fail. Only ask for one when it is strictly necessary.

Guidance

State the accepted file types and the maximum size up front, in the subtitle and the .govbb-file-upload__max-size text: users should not have to guess and fail. Keep uploaded files visible in the list (.govbb-file-upload__list) so users can confirm what they attached, and give each one a Remove action so they can correct a mistake without starting over.

Pair the dropzone with a .govbb-form-group, a visible .govbb-label naming what to upload, and a .govbb-hint giving an example, such as "This could be a recent utility bill or bank statement".

Errors

When an upload fails or a file is rejected, set aria-invalid="true" on the input and show an error message (.govbb-error-message) with role="alert", linked to the input with aria-describedby. Keep the message specific, such as "Select a file" or "The file must be smaller than 25MB".

File upload with an error