Skip to content

File Item ​

A file item represents a single file in a list. It shows the file name, size, status, and contextual actions such as download, delete, cancel, retry, or dismiss.

The bottom upload indicator is provided by catnip-progress, composed in its bar-only presentation. File Item owns the file-specific percentage and state; Progress owns the reusable bar and progress semantics.

Overview ​

The catnip-file-item component renders one row per file. Use it anywhere you need to display files — attached documents, upload progress, download lists, or validation feedback — not only inside a file input.

Common patterns:

  • Read-only file list: Show uploaded or attached files (status="ready"). Set showDownload and showDelete to false when the row has no actions.
  • Upload flow: Show progress and errors while files are being added (inProgress, warning, danger).
  • Future file input: A parent file input can compose multiple file items below its drop zone.

Statuses ​

StatusPurposeActions
readyFile is availableDownload, delete (showDownload / showDelete can hide them)
inProgressUpload is running. Metadata shows uploading-progress next to the percentage.Cancel
doneUpload just completedDownload, delete (showDownload / showDelete can hide them)
warningNon-critical validation issueRetry, dismiss
dangerUpload or validation failedRetry, dismiss

Sizes ​

  • m (default): Compact row for dense lists.
  • l: Taller row with larger typography and action targets.

Live example ​

Guidelines ​

  • Use ready when displaying files the user can download or remove — for example an attachments list or a completed upload summary. Set showDownload and showDelete to false for a read-only row.
  • Use inProgress while an upload is running. Bind progress (0–100) and handle cancel to abort the upload. The metadata row uses the uploading-progress icon next to the percentage.
  • File Item composes catnip-progress for its bottom bar. Do not add a second progress indicator for the same upload.
  • Use warning for recoverable validation issues (for example file too large). Provide a clear message and handle retry / dismiss.
  • Use danger for failed uploads. Provide a concise message explaining what went wrong.
  • Render one catnip-file-item per file. The parent (file input, page section, or modal) owns file data, upload orchestration, and list order.
  • Prefer size m in dense layouts; use l when there is more vertical space or larger touch targets are needed.

Catnip Design System by Signicat