Browse Components

Components

File upload

Allows users to upload files of various sizes and formats.

DesignUsageAccessibilityUpdates

Purpose

Attach files to a task

Use file upload when users need to attach documents, images, or other files.

Show selected files

Display the filename and size so users can check what they added.

Set file requirements

Use accepted types, size guidance, and feedback to reduce upload errors.

Anatomy

Choose file
1

Label (optional)

2

Action (button)

3

Hint text (optional)

Configuration

Variant

File upload supports a default button-style picker and a drag-and-drop surface.

Choose file

Use the default variant for compact forms or single file inputs.

Multiple files

Allow more than one file to be selected at once.

Upload file

Only one file can be selected; reselecting replaces the previous one.

Accepted file types

Restrict the file picker to specific file types using the accept attribute.

Upload file

No restriction on file type.

Disabled

Disable the upload button to prevent users from picking a file.

Upload file

Default interactive state.

Validation feedback

Show error styling and feedback when the upload is invalid.

Upload file

No feedback shown.

Structure

Upload file

Design tokens used

Each row is a colour, spacing, or size value the component uses, and the right-most column tells you where in the component you'll see it.

CategoryTokenValueWhere it's usedPaddingsgds-form-padding-xSpace between the left and right edges of the component and its contentsgds-form-padding-ySpace between the top and bottom edges of the component and its contentGapsgds-form-gap-lgSpacing between items of the file upload list itemsgds-form-gap-mdSpacing between items of the file upload containersgds-form-gap-smSpacing between items of the upload feedback messagesgds-form-gap-xlSpacing between items of the file upload listsgds-gap-md16pxSpacing between items inside the drag and drop zoneBordersgds-border-radius-md8pxCorner radius of the drag and drop zonesgds-border-width-11pxDashed border width of the drag and drop zonesgds-border-width-2Width variesError focus outline width of the drag and drop zonesgds-form-border-width-defaultWidth variesBorder of the file upload list itemsgds-form-border-width-thickWidth variesHover outline width of the drag and drop zoneTypographysgds-font-size-12Font size of upload item error messagesgds-font-size-14Font size of drag and drop helper textsgds-line-height-16Height variesLine height of upload item error messagesgds-line-height-20Height variesLine height of drag and drop helper textSizesgds-icon-size-mdSize of status icons in the upload listsgds-icon-size-lgSize of the drag and drop upload iconMarginsgds-margin-xlTop margin of the upload list when files are presentPaddingsgds-padding-2-xl32pxPadding of the drag and drop zoneMotionsgds-motion-duration-standardDuration of file upload item enter and exit animationssgds-motion-easing-enterEasing of the file upload item enter animationsgds-motion-easing-exitEasing of the file upload item exit animationsgds-motion-easing-standardEasing of file upload item transitionsOutlinesgds-form-outline-focusFocus outline of the drag and drop zonesgds-form-outline-offset-focusFocus outline offset of the drag and drop zoneBordersgds-form-border-radius-mdCorner radius of the file upload list item

Usage

When to use

  • Use this component to collect or change a specific piece of information in a predictable way.
  • Use it when the SGDS control matches the type of response users need to provide.

When not to use

  • Do not use this component when another SGDS control would reduce effort or make the choice clearer.
  • Do not ask for more information, options, or steps than users need at that point in the task.

Best practices

Upload document Accepted formats: PDF, JPG, PNG. Maximum 5 MB per file.
State the accepted file types and size up front

Tell users which file types and sizes are accepted before they pick a file to reduce failed uploads.

File
Do not leave the upload action ambiguous

Use a clear verb-led label inside the slot, for example Upload report, rather than generic File or Browse.

Upload PDF
Restrict file types in the picker

Set the accept attribute to filter the system file picker so users do not have to scan files manually.

Upload your reference number
Do not use file upload for very small text inputs

For a short value such as a reference number, use a text input. Uploading a file adds friction.

Upload supporting photos
Allow several files only when users genuinely need it

Add the multiple attribute when the task expects several files in one go, such as photo evidence.

Upload document
Show validation feedback when an upload is required

Pair required with hasFeedback and invalidFeedback so the empty state can be flagged inline.

Accessibility considerations

Built-in accessibility

  • File upload uses a native file input with SGDS button and close-button controls.
  • Selected files are rendered as a list with remove actions.

Labels and content

  • Explain accepted file types and size limits near the field.
  • Use validation feedback when a file is missing or not accepted.

Focus and interaction

  • Users should be able to reach the upload button and each remove-file button.
  • Do not hide file requirements until after the upload fails.

Keyboard interaction

KeyInteractionTabMoves focus from the upload or remove-file button to the next focusable element.Shift+TabMoves focus to the previous interactive element.EnterActivates the focused upload or remove-file button.SpaceActivates the focused upload or remove-file button.

Updates

DateVersionDescription08 Jun 2026v3.21.0New ariaLabel prop for accessibility support in #691.13 May 2026v3.19.0Drag and drop in #621.

Roadmap

Planned itemStatusTargetFuture enhancements for file uploadPlannedTBD

Feedback

Have suggestions or feedback?

Share them with us on Slack → #ask-sgds-v3

Bug Reports

Found a bug or issue?

Report it on GitHub Issues → sgds/components/file-upload

Singapore Government Design System

The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.

Past VersionsSGDS v1SGDS v2