Skip to content
Components / Collections

File thumbnail

An image preview or a file-type tile for file lists.

@fabrials/ui
Loading state
  • landscape.png previewlandscape.png
  • report.pdf
  • export.csv
  • voice-memo.m4a
  • backup.tar.gz

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { FileThumb, fileTypeLabel } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
srcstring | nullImage to preview. A broken image falls back to the tile.
mimestring | nullLabels the tile with filename, for example PDF or CSV.
iconReactNodeReplaces the default tile icon.
sizenumberSquare size in pixels.
altstringText alternative for the preview.

Behavior

fileTypeLabel returns the same short label for use elsewhere. The host decides which URLs are safe to preview.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.