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

ListItem

  • Stable
  • WCAG 2.2 evidence
  • RTL

One row of a list: optional leading icon, avatar or checkbox, a title with an optional subtitle, and an optional trailing badge, switch or chevron. Use it for rows of similar items; use a table for comparing values. Presentational: no state and no "use client", so it renders in React Server Components. Without href or onPress the row is static text. With href the title is a native link and with onPress a native button, in both cases stretched over the whole row, so there is one target named by the title; the row shows a hover fill and the focus ring inside its edge (WCAG 2.1.1, 2.4.7, 2.4.11, 2.5.8). Icons are decorative (1.1.1); nothing is conveyed by colour (1.4.1); text wraps (1.4.10, 1.4.12). Put the rows in a list: <ul> with one <li> per row, or role="list" on a container. Consumer duties: the title wording, names for any switch or checkbox passed in, and locale-aware formatting of dates and numbers in the text.

import { ListItem } from "@nexera-ui/react";
Loading example…
13
examples
10
props
2
live controls
1
platform
10
WCAG criteria
21
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…
title
isDisabled
Generated code
import { ListItem } from "@nexera-ui/react";

<ListItem />

Examples 12

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

Leading icon

Leading=Icon: the icon slot in a 36 px tile.

Loading example…

Leading avatar

Leading=Avatar: pass a decorative Avatar (the title names the person).

Loading example…

Leading checkbox

Leading=Checkbox: a named Checkbox in the leading slot, on a static row.

Loading example…

Trailing chevron

Trailing=Chevron: a link row (href) shows the chevron, which mirrors in right-to-left layouts.

Loading example…

Trailing switch

Trailing=Switch: a named Switch in the trailing slot, on a static row (a switch cannot sit inside a link row).

Loading example…

Trailing badge

Trailing=Badge: a Badge in the trailing slot.

Loading example…

Button row

A button row (onPress): the title is a native button stretched over the row.

Loading example…

Disabled

isDisabled: the text dims, the row is aria-disabled and stops being a link.

Loading example…

In a list

Rows in a list: <ul> with one <li> per row.

Loading example…

Long content

Long and translated text wraps; the trailing badge drops below the text when the row is too narrow for both.

Loading example…

Right to left

Right-to-left: the leading part sits at the start (right) and the chevron points left.

Loading example…

Narrow container

A 14 rem container: the text wraps and the trailing part moves under it.

Loading example…

Props 10

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

10 props shown

hrefNexera
string

Not set: the row is not a link. Destination. The title becomes a native link stretched over the whole row (one target; hover fill, focus ring on the row) and the chevron is shown. Renders in Server Components. Not with onPress.

Default –
onPressNexera
() => void

Not set: the row is not a button. Not with href. Called when the row is pressed (click, Enter or Space). The title becomes a native <button> stretched over the whole row. Function props only work from Client Components; in Server Components use href.

Default –
targetNexera
string

Only with href. Link target, for example _blank.

Default –
relNexera
string

Only with href. Link relation, for example noopener.

Default –
title*Nexera
ReactNode

Main text. On a link or button row it is the link text, so it is the accessible name of the row. Wraps instead of truncating.

Default –
subtitleNexera
ReactNode

Second line, shown when provided.

Default –
iconNexera
ReactNode

Icon in a 36 px tile before the text. 18 px, decorative.

Default –
leadingNexera
ReactNode

Control or picture before the text: pass <Avatar size="lg" isDecorative /> (40 px; decorative because the title names the person) or a <Checkbox aria-label="Select Ayesha Khan" />. Replaces the plan's leading enumeration, because a slot can carry the actual content. Shown after icon when both are set.

Default –
trailingNexera
ReactNode

Content at the end of the row: pass a <Badge /> or a <Switch aria-label="..." />. A link or button row shows the Figma chevron (Trailing=Chevron) when trailing is not set. A switch or checkbox cannot sit inside a link or button row (nested controls): leave href and onPress unset then.

Default –
isDisabledNexera
boolean

The row is unavailable: its text dims, a link or button row stops being one, and aria-disabled is set. Not in Figma (derived).

Default false

* 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

5 direct · 5 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.4.4Resize TextLevel AA · supporting test
  • 1.4.12Text SpacingLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.4Link Purpose (In Context)Level A · tested directly
  • 2.4.7Focus VisibleLevel AA · supporting test
  • 2.4.11Focus Not Obscured (Minimum)Level AA · supporting test
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · 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:.

Usage
<ListItem className="shadow-sm" />

Used in blocks

Related components