Skip to content
Playground

File Icons

File-type illustrations for attachments, upload rows, and file cards.

File icons are the folded-sheet illustrations inside File Card. Each icon stamps a short label on a paper sheet, and the label band takes its color from the file family. The same illustration is what an attachment list uses to tell a PDF from a spreadsheet at a glance.

PDF

Document

Spreadsheet

Presentation

Archive

Image

Video

Audio

Code

Other

TSX
import { FileCard, fileTypeFromName } from "@zentara-co/zenos-ui";

Pass a family with type, or derive it from a filename. The icon is decorative: the filename beside it names the file. Pass aria-label only when the icon stands alone.

TSX
<FileCard.Icon type="pdf" /><FileCard.Icon type={fileTypeFromName("Q3 revenue.xlsx")} /><FileCard.Icon type="code" label="TSX" />

label replaces the short stamp. Use it when a product-specific extension should read differently from the family default, such as TSX on a code file. Leave it unset for the family’s own label.

fileTypeFromName reads the extension, ignores letter case, and returns one of ten families. An unknown extension, or a name with no extension, returns default. Prefer a trusted MIME type when the filename may be incomplete.

FamilyStampToneExtensions
pdfPDFRedpdf
documentDOCBluedoc, docx, odt, rtf, txt
spreadsheetXLSGreencsv, ods, xls, xlsx
presentationPPTOrangekey, odp, ppt, pptx
archiveZIPYellow7z, gz, rar, tar, zip
imageIMGPurplegif, heic, jpeg, jpg, png, svg, webp
videoVIDMagentaavi, mkv, mov, mp4, webm
audioAUDTealaac, flac, m4a, mp3, ogg, wav
codeCODEIndigocss, html, js, json, jsx, md, py, ts, tsx, yaml, yml
defaultFILEGrayAnything else

Tones use accent tokens, so they follow the active theme.

File Card places the icon at the start of a row or at the top of a tile. Pass the derived type and keep the real filename in FileCard.Name. The card page covers progress, upload state, and actions.

Brand guidelines.pdf
PDF · 4.2 MB
Q3 revenue.xlsx
Spreadsheet · 860 KB
Launch film.mp4
Video · 128 MB

Inside a card, the icon size follows the card layout and density. A comfortable row uses the larger sheet; compact rows and tiles scale it with the card. Override the frame with className when the icon needs a different box outside that layout.