Upload Button
betaA pill upload button that draws in to a circle, fills a progress ring, draws a check and opens back out into the pill.
- Forms
- 1 file
- 1 npm package
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add upload-buttonnpm packages installed: class-variance-authority.
import { UploadButton } from "@/components/ui/upload-button";Default
Demo
Real Progress
Sizes
<UploadButton>
| Prop | Type | Default |
|---|---|---|
accentColour of the working circle. Defaults to the foreground. | string | — |
defaultStatusInitial status when uncontrolled. | UploadButtonStatus | "idle" |
doneLabelAnnounced when finished. | string | "Uploaded" |
durationHow long the simulated fill takes, in milliseconds. Scaled by --motion-scale. | number | 1200 |
labelThe visible label and accessible name. | string | "Upload" |
onStatusChangeCalled when the button moves to a new status: on press, when the ring closes, and when it reopens. | (status: UploadButtonStatus) => void | — |
progressReal progress, 0–1. Omit it and the ring fills on its own over | number | — |
size | "sm" | "md" | "lg" | "md" |
statusControlled status. | UploadButtonStatus | — |
uploadingLabelAnnounced while working. | string | "Uploading" |
Plus every attribute of <button> except children.
A native <button> named by its visible label throughout. While working it is aria-busy and aria-disabled rather than disabled, so keyboard focus stays on it and a second press is ignored. A visually hidden polite live region beside it announces "Uploading" and then "Uploaded" once each; progress percentages are not announced. The ring and check are aria-hidden. Under reduced motion every step of the sequence still happens and is announced, but lands without animating.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes