Vue playground

Nova v3.37.0

Preview

Vue

File tile

nv-filetile

One file as a row with its type icon, name, size, upload status and an action to cancel, retry or remove it.

Parts

Live demo

State
Size

Overview

Use a file tile to show one file: in a list of attachments, after a file was chosen, or while it uploads. It is the row that file upload uses, and it works on its own for existing documents. The tile uploads nothing: your application sets its state and progress and reacts to its events.

Anatomy

The file upload anatomy shows completed, uploading and rejected file tiles together in the upload composition.

Parts

  1. Type icon: chosen from fileType or the extension in fileName.
  2. Name and size: the size in bytes is formatted for the user's language, such as "1.2 MB".
  3. Status: a progress bar while uploading, an indeterminate bar while processing, a check when complete, and an error message when error or invalid. queued, the default, shows no status.
  4. Action: cancel while uploading, no action while processing, and remove in other editable states. An error tile also offers "Try again". The tile only emits cancelClicked, removeClicked or retryClicked; your application changes the list.

States and themes

The six state values below describe upload progress. disabled and readonly add the two remaining design states: disabled actions stay visible but inert; read-only tiles have no actions. Both md and sm sizes support Spark and Ocean in light and dark mode.

queued · default
uploading
processing
complete
error
invalid

Accessibility

The file name labels the tile group, and its message is connected with aria-describedby. Cancel, remove and retry buttons include the file name in their accessible labels. Keep useful status text alongside colour and progress so the result can be understood without relying on appearance.

Content and usage

  • Name the reason in message, such as "File too large — max 10 MB".
  • Use readonly for files that can no longer change, and disabled to keep actions visible but unusable.
  • size="sm" suits dense layouts.
DoSay what went wrong and how to fix it.
Don'tAvoid vague messages such as “Error”.

An invalid file needs a message naming the constraint and only a remove action. Reserve Retry for error states that another upload attempt could resolve. locale controls built-in text and file sizes in English, French, Dutch and German, with English fallback.

Related

Use File upload for validation and list management, and Progress bar for the progress visualization.

Sources