Attachment: Sizes
size scales the padding, media and text together, and keeps the inner corners concentric with the card.
This adds the example as components/examples/attachment/sizes.tsx, together with the Attachment component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/attachment-sizes.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 |
|---|---|---|
size | "default" | "sm" | "xs" | "default" |
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.