File Item
- 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";- 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.
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).
import { FileItem } from "@nexera-ui/react";
import { LuImage } from "react-icons/lu";
export function States() {
return (
<ul className="m-0 flex list-none flex-col gap-3 p-0">
<li>
<FileItem
name="cnic_front.jpg"
meta="860 KB · waiting"
icon={<LuImage />}
onRemove={() => undefined}
/>
</li>
<li>
<FileItem
name="cnic_front.jpg"
icon={<LuImage />}
onRemove={() => undefined}
status="uploading"
progress={45}
meta="860 KB · 45% · 3 s left"
/>
</li>
<li>
<FileItem
name="cnic_front.jpg"
icon={<LuImage />}
onRemove={() => undefined}
status="complete"
meta="860 KB · uploaded"
/>
</li>
<li>
<FileItem
name="cnic_front.jpg"
icon={<LuImage />}
onRemove={() => undefined}
status="error"
meta="File is larger than 10 MB"
onRetry={() => undefined}
/>
</li>
</ul>
);
}
Simulated upload
A simulated upload: progress runs, then the row turns Complete and announces it politely. Press Retry to run it again.
import { useEffect, useState } from "react";
import { FileItem } from "@nexera-ui/react";
import { LuImage } from "react-icons/lu";
export function SimulatedUpload() {
const [progress, setProgress] = useState(0);
const status: FileItemStatus = progress >= 100 ? "complete" : "uploading";
useEffect(() => {
if (progress >= 100) return;
const timer = setTimeout(() => {
setProgress((value) => Math.min(100, value + 10));
}, 400);
return () => {
clearTimeout(timer);
};
}, [progress]);
return (
<FileItem
name="cnic_front.jpg"
icon={<LuImage />}
status={status}
progress={progress}
meta={status === "complete" ? "860 KB · uploaded" : `860 KB · ${String(progress)}%`}
onRemove={() => {
setProgress(0);
}}
/>
);
}
Long name and right to left
Long file names wrap instead of truncating; right-to-left layouts mirror the row.
import { FileItem } from "@nexera-ui/react";
import { LuFileText, LuImage } from "react-icons/lu";
export function LongNameAndRightToLeft() {
return (
<div className="flex flex-col gap-3">
<FileItem
meta="860 KB · waiting"
onRemove={() => undefined}
name="employment_contract_signed_final_version_2026_with_all_appendices_and_annexes.pdf"
icon={<LuFileText />}
meta="2.4 MB · waiting"
/>
<div dir="rtl" lang="ar">
<FileItem
name="بطاقة_الهوية.jpg"
icon={<LuImage />}
status="error"
meta="الملف أكبر من 10 ميغابايت"
retryLabel="إعادة المحاولة"
onRetry={() => undefined}
onRemove={() => undefined}
removeLabel="إزالة بطاقة_الهوية.jpg"
/>
</div>
</div>
);
}
Props 10
Press "Try it" on a card to load that prop into the playground.
10 props shown
name*NexerastringFile name, for example "cnic_front.jpg". Wraps instead of truncating, so it is always readable.
metaNexeraReactNodeLine 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".
iconNexeraReactNodeFile type icon in the tile. Decorative.
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).
progressNexeranumberUpload 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).
statusLabelsNexeraPartial<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.
onRemoveNexera() => voidShows 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).
removeLabelNexerastringAccessible name of the cancel or delete button. Name the action and the file. Translate it.
onRetryNexera() => voidShows the Retry button in the Error state and is called when it is activated.
retryLabelNexerastringVisible text of the retry button. Its accessible name adds the file name ("Retry cnic_front.jpg"). Translate it.
* 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.
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-disableddata-hovereddata-pressed
<FileItem className="data-disabled:opacity-90 shadow-sm" />Used in blocks
Related components
- CalendarDayOne day of a {@link CalendarMonth } grid, built on React Aria `CalendarCell`: a `gridcell` whose button is named by the full, localised date ("Wednesday, October 14, 2026"), with `aria-selected`, `aria-disabled` and the "today" and range descriptions read by screen readers (WCAG 1.3.1, 4.1.2).
- CalendarMonthA month calendar for picking a date or a date range: header with previous / next buttons and the localised month name, weekday row, and six weeks of `CalendarDay`s.
- CheckboxThe bare 18 px checkbox: one independent yes/no choice applied on submit, or a row selector in a table, list or tree.
- CheckboxCardA large checkbox option with an icon, a title and a description, for a few options that need explanation (notification channels, benefits).
- CheckboxFieldA checkbox with a label and optional helper text: the box (the same element as `Checkbox`) followed by the label and description, applied on submit.
- ColorInputA hex colour field with a swatch and a picker popover.
- ColorPickerPicks a colour.
- ColorTokenCardDocumentation card for one colour token: a 96 px colour sample with an "Aa" text sample, then the name, token path, hex value and contrast note as text.