Skip to main content

FileTile

import { FileTile, fileKind } from "@study/ui"

Result
Loading...
Live Editor
<List style={{ maxWidth: 480 }}>
  {["Script chapter 4.pdf", "Formula sheet.docx", "Lecture 27 Oct.m4a", "Blackboard.jpg"].map((name) => (
    <ListRow key={name} leading={<FileTile kind={fileKind(name)} />} title={name} meta="Scripts · today" />
  ))}
</List>

Variants and states​

Light

Dark

fileKind(name, mime?) determines the kind from the extension or MIME type.

Props​

PropTypeDefaultMeaning
kind *FileKind–
classNamestring–
sizenumber44Width and height in px.

Accessibility​

  • Pure decoration (aria-hidden); the file name next to it says everything.