Skip to content
Alea
Pro
  1. Alea
  2. Components
  3. Navigation
  4. OverflowList

Navigation

OverflowList

A row of items that shows as many as fit in its width and puts the rest behind a "more" menu button, for toolbars, tag rows and action bars.

import { OverflowList } from '@alea-design/ui';

Examples

Toolbar

A row of actions in a box you can resize. What does not fit moves into the "more" menu, in the same order.

Tags

Your own item with renderItem, a hard cap with maxVisible and your own text for the button.

Tokens

The design tokens this component reads, with their value in the current theme. Override any of them to restyle it.

Space

  • --alea-space-1…
  • --alea-space-2…

Component

  • --alea-overflow-gap…

Props

OverflowList props

A row that shows as many items as fit in its width and puts the rest behind a "3 more" menu button. For toolbars, tag rows and action bars. Before the page is hydrated (server rendering) every item is drawn and the menu button is not; the row folds as soon as it can measure itself. Items fold from the end: a long item at the start hides the short ones after it even if they would fit alone. It is a toolbar: one Tab stop, and the arrow keys move between the visible items and the button. Every item is measured once in a hidden copy, so the row never jumps.

PropTypeDefaultDescription
aria-labelrequiredstringNames the group for screen readers ("Document actions").
itemsrequiredOverflowItem[]The entries, in the order they appear. Those that do not fit move to the menu in the same order.
classNamestringnoneExtra class names for the row.
gapstring | number2The space between items: a step of the space scale. Default 2.
maxVisiblenumbernoneThe most items shown in the row, even when more would fit. The rest go to the menu.
moreLabelstring | ((hidden: number) => string)"3 more"The text of the button that opens the menu: a string, or a function of how many items are hidden. Default "3 more" (its accessible name is "3 more actions").
renderItem((item: OverflowItem) => ReactNode)noneDraws an item in the row. Default: a small ghost Button with the icon and label. Keep it free of ids: it is also drawn once, hidden, to measure it. Items in the menu are always plain menu entries.
size"sm" | "md""sm"The size of the buttons of the row, the menu button included. Default sm. With a coarse pointer (a finger) every button already gets a 44 px target.

Specs

Generated from the source: the variants in the types, the states and tokens in the CSS, and the motion patterns that apply. The grids render the real component in both themes; the numbers are measured from the page.

Variants
sizesmmd
Dark and light
Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
Styling hooks
.alea-overflow-bar.alea-overflow-more.alea-overflow-item.alea-overflow.alea-overflow-clip.alea-overflow-probe.alea-overflow-probe-item

Accessibility

  • The row is a toolbar named by aria-label: one Tab stop, and the arrow keys move between the visible items and the "more" button.
  • The button says how many items it holds ("3 more") and its accessible name says what they are ("3 more actions"); in Spanish "3 más" and "3 acciones más".
  • The menu is a normal menu: arrow keys, Enter to run an item, Escape to close, and focus goes back to the button.
  • Every item is measured in a hidden copy that is out of the accessibility tree and cannot take focus, so a screen reader never meets an item twice.

Keyboard

KeyDoes
TabEnters and leaves the row: it is one stop
Arrow keysMove between the visible items and the "more" button
Enter or SpaceRuns the item, or opens the menu on the button
EscapeCloses the menu and keeps focus on the button

Do and don't

Do

  • Name the group with aria-label ("Text formatting").
  • Put the most important items first: the last ones are the first to move into the menu.
  • Give every item a short label, even when renderItem shows only an icon.

Don't

  • Don't use it for page navigation: use Tabs or a Breadcrumb.
  • Don't put an id inside renderItem: each item is also drawn once, hidden, to measure it.
  • Don't make the row narrower than its menu button: below about 60 px even the button is cut.
  • Before the page is hydrated (server rendering) every item is drawn and the menu button is not; the row folds as soon as it can measure itself, so keep it out of the first screen of a page that must not move.
  • Don't put the row flush against the edge of a box that clips its content (overflow: hidden with no padding, like a card): the focus ring of any button needs 4 px of room, and the clip cuts it. Give that box padding.

In Figma

The properties of the Figma components, generated from the kit, so they always match it. The last column is the React prop each one stands for.

Overflow list · 2 variants

Figma propertyKindValuesDefaultReact prop
StateVariantAll fit, OverflowOverflowno React prop
Tested with axe, keyboard and screen reader roles