Attachment: Upload flow
Pass progress while state="uploading" to draw a thin progress bar along the bottom edge. Image previews stay dimmed until the upload is done.
This adds the example as components/examples/attachment/upload-flow.tsx, together with the Attachment component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/attachment-upload-flow.jsonTo add only the component, follow the Attachment installation.
Props in this example
The Attachment props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
state | "idle" | "uploading" | "processing" | "error" | "done" | "done" |
progress0 to 100. Shown only while uploading, and clamped to that range. | number | – |
Every prop is in the Attachment API reference.
See them all, with keyboard support and accessibility notes, on the Attachment page.
- Aspect ratioA box that holds its shape before media loads, shimmers while loading, fades the media in and falls back when it fails.
- ButtonButtons in every variant and size, with a built-in loading, success and error flow that skips the spinner for fast requests.
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- ProgressA bar or ring that shows how far a task has come, eases between updates and slides while the total is unknown.
- Scroll areaNative scrolling with a minimal scrollbar, edges that fade only where there’s more to see, and an optional peek that cuts the last item in half.
- BubbleChat message bubbles with variants, grouped corners, reactions and room for interactive content.