Skip to content

File Result

The file an agent made, as a card in the chat: a tile with the file's kind, the name, size, pages and where it was saved, a thin bar while it is still being written, an error with Try again, and Open and Download.

On this page
Used for
  • Generated report in chat
  • Export ready to download
  • File still being written
  • Failed export with retry

Examples

Installation

npx knowns-ui@latest add file-result
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

name
string
File name with its extension. The tile's label and tint come from it.
kind
"pdf" | "sheet" | "doc" | "slides" | "image" | "archive" | "code" | "text" | "file"
Defaultfrom the name
Override the kind.
size
number
Bytes, shown as 184 KB (1 KB is 1000 bytes).
meta / location
ReactNode
More facts after the size: 2 pages / saved to Documents.
status
"generating" | "ready" | "error"
Default"ready"
Generating shows a thin bar along the bottom and holds Open and Download back.
progress / progressLabel
number / ReactNode
Default - / "Writing the file"
0 to 1 while generating; without it the bar runs open-ended.
error / onRetry
ReactNode / () => void
With status error: what went wrong, and Try again.
href / onOpen
string / () => void
Open as a link or a button.
downloadHref / onDownload
string / () => void
Download as a link with the download attribute, or a button.
preview
ReactNode
A first-page thumbnail instead of the kind tile, 40 by 48.

Accessibility

  • The card is a group named "File: name", so the actions after it are heard in context.
  • While generating it is aria-busy and the bar is a named progressbar; the error line is an alert.
  • Download is an icon button named "Download name". The kind tile is decorative: the extension is in the name.

What it handles

  1. 01Shows a tile with the file's extension, tinted by kind: PDF red, sheets green, docs blue, slides amber, images pink.
  2. 02Lists the name, the size in KB or MB, more facts such as pages or rows, and where it was saved.
  3. 03Runs a thin bar along the bottom while the file is written, with a percent when you give the progress.
  4. 04Holds Open and Download back until it is ready, then shows them as links or buttons.
  5. 05Shows what went wrong with Try again when it fails.
  6. 06Takes a first-page preview instead of the tile.

States

First render
The card as it is; nothing moves
none
Generating
The bar fills or runs open-ended
none
Ready
Open and Download appear
none

Works with

When to use

When to use

  • The file an agent wrote in a chat turn (a brief, an export, a deck), with Open and Download once it is ready.
  • A file that is still being made, or one that failed, with Try again.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI File Result to my app and wire it to my own data.
  • I need the file an agent wrote in a chat turn (a brief, an export, a deck), with Open and Download once it is ready. Set that up with the Knowns UI File Result.
  • Which File Result props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "file-result" }) and search_docs({ query: "file result" }).

Need help?

Stuck on File Result, or found something off? We read every message.