UILab

Attachment

Displays a file, image, or media attachment with support for states, sizes, and orientation.

report.pdf2.4 MB
"use client"
import {
  Attachment,
  AttachmentMedia,
  AttachmentContent,

Usage

import { Attachment, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription } from "uilab-core"
<Attachment>
  <AttachmentMedia>
    <FileTextIcon />
  </AttachmentMedia>
  <AttachmentContent>
    <AttachmentTitle>report.pdf</AttachmentTitle>
    <AttachmentDescription>2.4 MB</AttachmentDescription>
  </AttachmentContent>
</Attachment>

Examples

States

Use the state prop to show idle, uploading, processing, error, or done states.

selected-file.pdfReady to upload
design-system.zipUploading · 64%
market-research.pdfProcessing
financial-model.xlsxFailed to upload. Please try again.
uploaded-report.pdfUploaded · 1.8 MB
"use client"
import {
  CheckIcon,
  ClockIcon,
  FileTextIcon,

Sizes

Use the size prop to change the size.

Default2.4 MB
Small2.4 MB
Extra small2.4 MB
"use client"
import {
  Attachment,
  AttachmentMedia,
  AttachmentContent,

Vertical

Use orientation="vertical" inside AttachmentGroup for a gallery-style layout.

image1.png1.2 MB
image2.png0.8 MB
"use client"
import {
  Attachment,
  AttachmentGroup,
  AttachmentMedia,

Actions

Use AttachmentActions and AttachmentAction to add remove or download buttons.

report.pdf2.4 MB
"use client"
import {
  Attachment,
  AttachmentMedia,
  AttachmentContent,

Trigger

Add an AttachmentTrigger to make the whole card open a dialog or link — actions stay independently clickable.

report.pdf2.4 MB
"use client"
import {
  Attachment,
  AttachmentMedia,
  AttachmentContent,

Image

Set variant="image" on AttachmentMedia and render an <img> inside it.

Жишээ зураг
image.jpg1.1 MB
"use client"
import { Attachment, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription } from "uilab-core"

export function AttachmentImageExample() {
  return (

Group

Wrap attachments in AttachmentGroup to lay them out in a horizontally scrollable, snapping row.

report.pdf2.4 MB
data.xlsx856 KB
image.png1.1 MB
"use client"
import {
  Attachment,
  AttachmentGroup,
  AttachmentMedia,

On this page