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

ConversationItem

  • Stable
  • WCAG 2.2 evidence
  • RTL

One conversation in a list: avatar, name, time, the last message and an unread count. Built on React Aria Link: with href it is a native <a> (client-side routing through RouterProvider), without it a focusable link that calls onPress. Enter activates it, the focus ring is drawn inside the row, and the whole 60 px row is the target (WCAG 2.1.1, 2.4.7, 2.5.8). The current conversation carries aria-current (1.3.1, 4.1.2). Its accessible name is the row's text in reading order: name, muted, time, preview and the unread count as words ("2 unread messages"), so nothing depends on colour or the badge shape (1.1.1, 1.4.1, 2.4.4). Consumer duties: render the items in a list (<ul>/<li>) inside a labelled nav or region ("Conversations"); a translated unreadLabel and mutedLabel; links to real conversation URLs where possible.

import { ConversationItem } from "@nexera-ui/react";
Loading example…
4
examples
31
props
3
live controls
1
platform
10
WCAG criteria
1
block uses 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…
isMuted
isCurrent
isDisabled
Generated code
import { ConversationItem } from "@nexera-ui/react";

<ConversationItem />

Examples 3

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

List

A conversation list in a labelled nav: the current one carries aria-current; press another to switch.

Loading example…

Long content

Long names and previews end with an ellipsis; the time and the count keep their place.

Loading example…

Right to left

Right-to-left: the avatar is on the right and the time on the left.

Loading example…

Props 31

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

31 props shown

name*Nexera
string

Who the conversation is with. One line with an ellipsis; the full name is part of the link's accessible name.

Default –
previewNexera
ReactNode

Last message. One line with an ellipsis; the full text is part of the accessible name and shown in the conversation.

Default –
timeNexera
ReactNode

Time of the last message, formatted for the reader's locale.

Default –
dateTimeNexera
string

Machine-readable time of time (ISO 8601). When set, the time is a <time> element.

Default –
unreadNexera
string | number

Unread messages. A number is shown in the locale's digits; a string (for example "99+") as given. Shows the count badge and the unread styling (bold preview, brand time). Not shown when omitted or 0.

Default –
unreadLabelNexera
(unread: string) => string

Text alternative of the unread badge, from the displayed count; it replaces the bare number for screen readers (WCAG 1.1.1, 1.4.1). Translate it, with your locale's plural rules.

Default (unread) => unread === "1" ? "1 unread message" : `${unread} unread messages`
isMutedNexera
boolean

Notifications are muted: the name turns text/secondary and Icon/LuVolumeX follows it, with the text alternative mutedLabel.

Default false
mutedLabelNexera
string

Text alternative of the muted icon. Translate it.

Default Muted
isCurrentNexera
boolean

This is the open conversation: nav/active-bg fill and aria-current="page" (WCAG 1.3.1, 4.1.2). Pass aria-current="true" instead when the list does not change the page URL.

Default false
avatarNexera
ReactNode

Avatar: pass <Avatar size="lg" isDecorative... /> (the name is read already). A presence inside it that is not decorative adds its status ("Online") to the link's name.

Default –
classNameNexera
string

Extra classes, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style.

Default –
isDisabledReact Aria
boolean

Whether the link is disabled.

Default –
onPressReact Aria
(e: PressEvent) => void

Handler that is called when the press is released over the target.

Default –
onPressStartReact Aria
(e: PressEvent) => void

Handler that is called when a press interaction starts.

Default –
onPressEndReact Aria
(e: PressEvent) => void

Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.

Default –
onPressChangeReact Aria
(isPressed: boolean) => void

Handler that is called when the press state changes.

Default –
onPressUpReact Aria
(e: PressEvent) => void

Handler that is called when a press is released over the target, regardless of whether it started on the target or not.

Default –
autoFocusReact Aria
boolean

Whether the element should receive focus on render.

Default –
hrefReact Aria
string

A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).

Default –
hrefLangReact Aria
string

Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).

Default –
targetReact Aria
HTMLAttributeAnchorTarget

The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).

Default –
relReact Aria
string

The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).

Default –
downloadReact Aria
string | boolean

Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).

Default –
pingReact Aria
string

A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).

Default –
referrerPolicyReact Aria
"" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"

How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).

Default –
routerOptionsReact Aria
never

Options for the configured client side router.

Default –
aria-labelReact Aria
string

Defines a string value that labels the current element.

Default –
aria-labelledbyReact Aria
string

Identifies the element (or elements) that labels the current element.

Default –
aria-describedbyReact Aria
string

Identifies the element (or elements) that describes the object.

Default –
idReact Aria
string

The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).

Default –

* 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

8 direct · 2 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
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.3Focus OrderLevel A · tested directly
  • 2.4.4Link Purpose (In Context)Level A · tested directly
  • 2.4.7Focus VisibleLevel AA · tested directly
  • 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:.

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

Used in blocks

Related components