v0.0.2
Demos (demo panel, opens in a new tab)

File icon

A page icon that shows the file type by colour, for file lists, attachments and downloads.

zb:file-icon zubazar/ui · free (MIT)

Types

Types: view
BLADE

name takes the file name or just the extension; PDF is red, spreadsheets green, documents blue, slides orange, images purple, archives yellow, audio and video sky blue, others grey.

blade
<div class="flex flex-wrap items-end gap-3">
    <zb:file-icon name="invoice-2026-10.pdf" />
    <zb:file-icon name="stock-list.xlsx" />
    <zb:file-icon name="contract.docx" />
    <zb:file-icon name="deck.pptx" />
    <zb:file-icon name="product-photo.webp" />
    <zb:file-icon name="backup.zip" />
    <zb:file-icon name="promo.mp4" />
    <zb:file-icon name="audit.log" />
</div>
PropValues
nameFile name or extension

In a file list

In a file list: view
BLADE

Use the icon with the file's name and size; size sm · md · lg.

blade
<ul class="divide-y divide-line rounded-sm border border-line bg-surface">
    <li class="flex items-center gap-3 px-4 py-3">
        <zb:file-icon name="invoice-2026-10.pdf" size="sm" />
        <span class="min-w-0 flex-1 truncate text-sm">invoice-2026-10.pdf</span>
        <span class="text-xs text-muted">284 KB</span>
    </li>
    <li class="flex items-center gap-3 px-4 py-3">
        <zb:file-icon name="stock-list.xlsx" size="sm" />
        <span class="min-w-0 flex-1 truncate text-sm">stock-list.xlsx</span>
        <span class="text-xs text-muted">1.2 MB</span>
    </li>
</ul>
PropValues
sizesm · md · lg

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
name—''File name or extension; the colour comes from the extension
size—mdsm · md · lg

Developer notes

Events, hooks and details
  • The colour comes from the extension; the icon is decorative, so write the file name next to it.
Zubazar UI · ZubazarDesigned for people.