Overflow List

A "+3 more" chip list or avatar stack that always keeps failed items, you and pinned items visible, and says what the overflow hides.

StopsFailed item hidden behind "+3 more"

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/overflow-list.json

The files land in your project. They're yours to edit.

Usage

overflow-list-usage.tsx
import { OverflowList, type OverflowItem } from "@/components/ui/overflow-list"

<OverflowList label="Checks" items={checks} max={3} />

What it catches

  • Failed or error items hidden behind "+N more"
  • The signed-in user folded into the overflow
  • Bare counts that hide what kind of items are folded
  • Pinned items: always shown

Props

OverflowList props
PropTypeDefault
items* (required)

Everything in the list, in display order.

OverflowItem[]—
max

How many items to show before folding the rest into "+N more". Pinned items may exceed it.

number4
variant

`chips` for tags and statuses, `avatars` for an overlapping people stack.

"chips" | "avatars""chips"
label* (required)

Accessible name of the list, such as "Reviewers".

string—
moreLabel

Word after the hidden count.

string"more"
lessLabel

Label of the button that folds the list back.

string"Show less"
youLabel

Text added to the current user's item.

string"You"
expanded

Controlled expanded state.

boolean—
defaultExpanded

Initial expanded state when uncontrolled.

booleanfalse
onExpandedChange

Called when the expand button is pressed.

(expanded: boolean) => void—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Labelled list; each item's text includes its status
  • Status is shown by icon and text, not colour alone
  • Avatar images have empty alt with the name in text; initials are aria-hidden

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

  • max is a count, not measured width
  • Warning items can still fold; only errors are always kept

What it stops

Failed item hidden behind "+3 more"

Also known as

+n more · avatar group · chips · tags · overflow · facepile · assignees · badges

Dependencies

Pairs well with