The five states
Done (a clipped slip), uploading (a pencil bar), processing (the same bar, pulsing), error (red pencil and a retry) and idle (a dashed slot waiting for a file).
A file handed over in a conversation: a slip clipped to the message, or a print taped up. Five states (idle, uploading, processing, error, done), a pencil progress bar and a remove button. The pencil traces the slip, dashes it while it is only a promise and goes red when it fails.
npx shadcn@latest add @wobko/attachmentFirst time here? Add the registry to components.json first. How to install
Done (a clipped slip), uploading (a pencil bar), processing (the same bar, pulsing), error (red pencil and a retry) and idle (a dashed slot waiting for a file).
Progress is a CSS variable: the hatched fill is drawn once and clipped to the value, so a fast upload never redraws anything. The finished slip gets its clip and becomes pressable.
orientation="vertical" is a photo with a white border, taped up. Put an `<img>` in the media; here a doodle stands in. A group scrolls sideways and snaps when its prints are wider than the box.
The root and the drawing: a `Paper` slip (horizontal) or a taped photo (vertical) behind the content, with a hand-traced outline on top. A finished slip carries a paper clip, a finished print a strip of tape.
| Prop | Type | Default | Description |
|---|---|---|---|
| state | "idle" | "uploading" | "processing" | "error" | "done" | "done" | Idle is a dashed empty slot with no paper, error is red pencil on a red wash, uploading and processing are the same slip with a second, looser pass and a pulsing title. |
| size | "default" | "sm" | "xs" | "default" | Padding and type size. |
| orientation | "horizontal" | "vertical" | "horizontal" | A file chip, or a print with a caption in its white border. |
| seed | string | number | - | Pins the hand. |
The tile a file's icon or thumbnail sits in: a paper-shade blob and a pencil loop, red in the error state. A bare glyph is held to 16 px (24 px in a print); a `Doodle` or `Sticker` keeps the size you give it.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "icon" | "image" | "icon" | `image` frames a picture (`<img>`) that covers the tile; it is dimmed while the file is uploading or processing. |
The pencil bar: a ruled box with a hatched fill. The fill is drawn once at full length and clipped by CSS to the value, so progress never redraws it.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | - | 0 to `max`. Undefined makes an indeterminate bar (the hatching pulses). |
| max | number | 100 | The value that means done. |
The files the CLI copies into your project.
Loading the source