Skip to content

Name List

Free

Writes a list of names as a sentence, such as Ana, Ben, and 3 others, with the commas and joins of the reader's language. The rest open in a popover.

  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Pass the names. Put a NameListEmpty inside for the words that show when the list is empty.

liked-by.tsx

NameList

<span>
PropTypeDefaultDescription
itemsRequiredreadonly NameListItem[]—The names, in the order they read.
maxnumber2The most names that show before "N others". Default 2.
type"and""or"—and (default: "Ana and Ben") or or ("Ana or Ben").
length"long""narrow""short"—The join words of Intl.ListFormat: long (default, "and"), short ("&"), narrow.
rest"none""popover""popover"popover (default): the rest is a button that opens a Popover with the other names. none: plain text ("3 others"), for a place with no room for a popup (a Toast, a row that is a link).
labelsPartial<NameListLabels>—The words (NameListLabels). Keep the object and its functions stable (module level).
renderItem—Renders one name: a link, an Avatar and a name, a Hover Card. Default: the label in weight 600. The rest Popover renders its names with it too.
childrenReactNode—A NameListEmpty part: the words of no value. With a value, they are not drawn.
localestring—The BCP 47 locale. Default: the DisplayLocaleProvider locale, else "en-US".
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

NameListEmpty

<div>
PropTypeDefaultDescription
data-slotstring—The data-slot of the root: the item's own slot ("time-ago"). Default "empty-value".
From Base UIUseRenderBase UI docs
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Pass items as strings, or as { id, label } when two people can share a name.
  • Set max for the names that show before the rest.
  • Use rest="none" where a popup has no room, as in a Toast.
  • Use renderItem to show a link or a face per name.
  • For faces in a row, use an Avatar.
  • For a list of items that are not names, use a Data List.
TabMoves to the rest button.
EnterOpens the Popover with the other names.
SpaceOpens the Popover with the other names.
EscapeCloses the Popover.

The rest is a button with a name such as "Show 3 more people".

The rest button has a 44px touch target.

Rest Popover open
popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1)
Rest Popover close
popup-exit · 120ms · ease-out (0, 0, 0.2, 1)

Built with

Installs with Name List

Components
Popover
  1. AddedName List, with Popover.
Open the release