FileCard

A file shown as a card with its type icon, name and size, or as an image, video or audio preview.

Basic

Pass name and byte to show a file with its size, under an icon that follows the extension, like a PDF, a spreadsheet or an archive.

Image

Give an image file a src to show the picture itself, which opens a full-size preview on click.

Image as a file

Set type to file to show an image as a file card with its name and size instead of the picture.

Loading

Set loading while an image uploads to show a placeholder with its progress, then the picture once it is ready.

Size

Set size to small for a shorter card that fits beside a chat message.

Description

Pass description text, or a function that receives the formatted size, to replace the line under the name.

Icon

Pass icon a preset name like pdf to pick the file glyph yourself, or any node to draw your own.

Mask

Pass mask, a node or a function of the file, to cover the card on hover with actions like preview and download.

List

Use FileCard.List to lay out several files in a row, and set removable with onRemove to let people take one out.

Overflow

Set overflow to scrollX to keep a long list on one row, with arrows to scroll through it.

In context

The component inside real screens, with the components it usually sits beside.

Download button

File cards whose description function puts the size beside a download button that works without opening the file.

Files in a chat

A chat where the user sends two spreadsheets and the assistant answers with a summary and a report to open.

Shared files

A project card listing the documents and images its members shared, each with its size and who uploaded it.

Generated images

An image assistant that answers a prompt with four generated pictures, plus buttons to regenerate or download them.