Get StartedComponentsStylingThemingMath & Science
MCP

Chat

Attachment

Attached files: rows, thumbnail cards and upload progress.

Markdown

Import

tsx
import { Attachment } from "@indoku/ui"

Examples

Basic usage

invoice-september.pdf

470.7 KB

rekap-penjualan.xlsx

workspace.png

PNG · 820.3 KB

desk-reference.jpg

JPG · 820.3 KB

office-reference.jpg

JPG · 820.3 KB

sales-dashboard.pdf

Uploading · 64%

rekap-penjualan.xlsx

Props

Root

PropTypeDefaultDescription
onClick() => void–Click handler for the whole card (not the action buttons). Usually opens a preview.
orientation"horizontal" | "vertical"horizontal"vertical" renders a square card (thumbnail on top, name below). Pairs well with Attachment.Group.

Media

PropTypeDefaultDescription
srcstring–Thumbnail image URL. Without it, an icon based on kind is shown.
altstring–
kind"file" | "code"fileBuilt-in icon: "file" or "code" (</>). Ignored when src is set.
loadingboolean–Show a spinner (upload in progress).

Meta

PropTypeDefaultDescription
sizenumber–File size in bytes. Formatted automatically (e.g. 1200000 → "1.1 MB").
formatstring–Format label shown before the size, e.g. "PNG" → "PNG · 820 KB".

Status

PropTypeDefaultDescription
status*AttachmentStatus–
progressnumber–0–100. Used when status is "uploading".
variant"bar" | "text"bar"bar" renders a progress bar. "text" renders "Uploading · 64%" (pair with <Attachment.Media loading />).

Action

PropTypeDefaultDescription
"aria-label"*string–Defines a string value that labels the current element.
childrenReactNode–

* required. Style props and HTML attributes are accepted as well.

Created by @indokudev