FilePreview

Compact file, code, and media thumbnails for file attachment metadata.

Preview#

PDFZIPHTMLIMGMP4
import {
  FilePreview,
  FilePreviewBadge,
  FilePreviewDocument,
} from "raft-ui";

<FilePreview>
  <FilePreviewDocument />
  <FilePreviewBadge>PDF</FilePreviewBadge>
</FilePreview>
PDFDOCXTXT

Inline badge#

PDFquarterly-report.pdf
ZIPdesign-assets.zip

File kinds#

ZIPHTMLIMG

FilePreviewMedia owns the frame, crop, and rounding. Supply an image, video, SVG, or other preview through children.

PNGMP4JPG

API#WIP

...props
span props
Preview root and positioning context for the visual part and badge.
...props
span props
Document-sheet illustration.
...props
span props
Archive/file illustration.
...props
span props
Code-file illustration.
...props
span props
Cropped media frame. Pass image, video, SVG, or other decorative preview content as children; image and video thumbnails typically use size-full object-cover.
placementdefault: "corner"
"corner" | "inline"
corner tags the bottom-right of a FilePreview icon; inline is a fixed-width chip of its own, placed before a file name in a row or a head.
...props
useRender.ComponentProps<"span">
Format label such as PDF or TXT.