Skip to content

File Icon

Free

The icon of a file: a neutral page with a folded corner, a sketch of what is inside, and one colored type tag.

  • React 19
  • Tailwind CSS 4

Added Nov 16, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Give each file row its icon from the name and the MIME type. The tag shows the extension, and the sketch and the hue show the kind.

recent-files.tsx

FileIcon

<svg>
PropTypeDefaultDescription
file—The file to draw: its kind and its type tag come from the name and the MIME type.
kind"archive""audio""code""data""design""document""file""image""pdf""sheet""slides""video"—The kind, when there is no file (or to override it).
childrenstring—The tag at 40px and up; default the file's type ("PDF"), else the kind's word. 5 letters at most.
pixelSizenumber40The height in px; the width is 0.8 of it. Default 40.
...props<svg> attributes—Every other attribute goes to the <svg>, with a ref.
  • Use it beside a file name: pass file with the name and the MIME type, and the kind and the tag come from them.
  • Use kind when you have no file, or to override the kind that the name gives.
  • Use 40px and up for the full sketch and the labeled tag; use 17 to 39px in rows, and 16px or less in chips.
  • To show the file itself with its name, size, and actions, use an Attachment.
  • To show a photo of the file content, use an Image.

The icon is an svg with aria-hidden: it is decoration. The file name beside it names the file.

The kind shows in three ways at 40px and up: the sketch, the tag text, and the hue. Below 40px the sketch and the hue still differ by kind.

Motion
none · the icon is still: it changes at once when the file or the size changes
  1. AddedFile Icon.
Open the release