Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

FileItem

  • Stable
  • WCAG 2.2 evidence
  • RTL

One file in an upload list: a type tile, the name, an optional progress track, a meta line, and the actions of its state. Upload logic stays in your app: pass status, progress and meta as the upload proceeds. The status is stated in text for assistive technology and changes to Complete or Error are announced politely, with the meta text of an error (WCAG 4.1.3, 1.4.1, 3.3.1). Retry and cancel/delete are real buttons with names that include the file name (2.4.6, 4.1.2), reachable with Tab and activated with Enter or Space (2.1.1); their 18 px icons get a 24 px target (2.5.8). The progress track is a progressbar named by the file name. Consumer duties: meta and error wording; moving focus after a file is removed; wrapping the items of a list in <ul>/<li> (or role="list") when there are several.

import { FileItem } from "@nexera-ui/react";
Loading example…
4
examples
10
props
1
live controls
1
platform
11
WCAG criteria
2
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
status
Generated code
import { FileItem } from "@nexera-ui/react";

<FileItem />

Examples 3

The same examples as Storybook, rendered live. Open Code to copy one.

States

Every Figma State with its actions: cancel (Queued, Uploading), delete (Complete), retry and remove (Error).

Loading example…

Simulated upload

A simulated upload: progress runs, then the row turns Complete and announces it politely. Press Retry to run it again.

Loading example…

Long name and right to left

Long file names wrap instead of truncating; right-to-left layouts mirror the row.

Loading example…

Props 10

Press "Try it" on a card to load that prop into the playground.

10 props shown

name*Nexera
string

File name, for example "cnic_front.jpg". Wraps instead of truncating, so it is always readable.

Default –
metaNexera
ReactNode

Line under the name, for example "860 KB · waiting", "860 KB · 45% · 3 s left" or, in the Error state, what went wrong and how to fix it ("File is larger than 10 MB"). Shown in the danger colour while status="error".

Default –
iconNexera
ReactNode

File type icon in the tile. Decorative.

Default <IconFileText />
statusNexera
"queued" | "uploading" | "complete" | "error"

Upload state: queued, uploading (shows the progress track), complete (check icon, delete action) or error (danger stroke and tile, retry action). Changes to complete and error are announced politely (WCAG 4.1.3), and every state is also given in text for assistive technology, never by colour alone (1.4.1).

Default queued
progressNexera
number

Upload progress from 0 to 100 while status="uploading". Leave it out when the progress is unknown: the track then shows the indeterminate animation (reduced-motion aware).

Default –
statusLabelsNexera
Partial<Record<FileItemStatus, string>>

Text that states each status for assistive technology (visually hidden; the visible meta usually says it too) and starts the announcement. Translate it.

Default { queued: "Waiting to upload", uploading: "Uploading", complete: "Upload complete", error: "Upload failed" }
onRemoveNexera
() => void

Shows the cancel button (Icon/LuX; Queued, Uploading, Error) or the delete button (Icon/LuTrash2; Complete) and is called when it is activated. Move focus to a sensible place afterwards (the next file, or the dropzone's Browse button).

Default –
removeLabelNexera
string

Accessible name of the cancel or delete button. Name the action and the file. Translate it.

Default "Cancel upload of <name>" (Queued, Uploading), "Remove <name>" (Error), "Delete <name>" (Complete)
onRetryNexera
() => void

Shows the Retry button in the Error state and is called when it is activated.

Default –
retryLabelNexera
string

Visible text of the retry button. Its accessible name adds the file name ("Retry cnic_front.jpg"). Translate it.

Default Retry

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

7 direct · 4 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.4.1Use of ColorLevel A · tested directly
  • 1.4.10ReflowLevel AA · supporting test
  • 1.4.12Text SpacingLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.6Headings and LabelsLevel AA · tested directly
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 3.3.1Error IdentificationLevel A · supporting test
  • 4.1.2Name, Role, ValueLevel A · tested directly
  • 4.1.3Status MessagesLevel AA · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

  • data-disabled
  • data-hovered
  • data-pressed
Usage
<FileItem className="data-disabled:opacity-90 shadow-sm" />

Used in blocks

Related components