Skip to content

OverflowList

Renders as many items as fit in one row and collapses the remainder into a custom overflow indicator. To measure natural item widths accurately, `OverflowList` renders every child in a hidden, inert measurement row, then renders the visible slice again. Visible child components therefore mount twice, and even collapsed children mount once for measurement. Avoid using it for hundreds of expensive items without first virtualizing or reducing them. Unrecognized props (`id`, `aria-*`, `data-*`, event handlers, …) are forwarded to the visible row.

DesignEngineeringResearchOperationsSupport
<OverflowList
{...args}
overflowRenderer={overflowBadge}
style={{maxWidth: 360}}>
{labels.map(label => (
<Badge key={label} label={label} />
))}
</OverflowList>
DesignEngineeringResearchOperationsSupport
<OverflowList
{...args}
overflowRenderer={overflowBadge}
style={{maxWidth: 360}}>
{labels.map(label => (
<Badge key={label} label={label} />
))}
</OverflowList>
DesignEngineeringResearchOperationsSupport
<OverflowList
{...args}
overflowRenderer={overflowBadge}
style={{maxWidth: 360}}>
{labels.map(label => (
<Badge key={label} label={label} />
))}
</OverflowList>
Teams:
DesignEngineeringResearchOperationsSupport
<div
style={{
alignItems: 'center',
display: 'flex',
gap: 12,
maxWidth: 420,
}}>
<span style={{whiteSpace: 'nowrap'}}>Teams:</span>
<OverflowList {...args} overflowRenderer={overflowBadge}>
{labels.map(label => (
<Badge key={label} label={label} />
))}
</OverflowList>
</div>

Renders as many items as fit in one row and collapses the remainder into a custom overflow indicator. To measure natural item widths accurately, `OverflowList` renders every child in a hidden, inert measurement row, then renders the visible slice again. Visible child components therefore mount twice, and even collapsed children mount once for measurement. Avoid using it for hundreds of expensive items without first virtualizing or reducing them. Unrecognized props (`id`, `aria-*`, `data-*`, event handlers, …) are forwarded to the visible row.

PropTypeDefaultDescription
behavior'observeParent' | 'observeSelf''observeSelf'Element whose width controls the fit calculation. observeParent uses the parent's content width and is useful when the list shares a flex row with other content.
children*ReactNodeItems to measure and render.
classNamestringAdditional CSS class names applied to the visible row.
collapseFrom'end' | 'start''end'Side of the list from which items are collapsed.
data-testidstringTest ID applied to the visible row. The hidden measurement row uses the same value with a -measure suffix.
gap0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 100Gap between visible items, on the spacing scale.
minVisibleItemsnumber0Minimum number of items kept visible even when they exceed the available width.
overflowRenderer(overflowItems: OverflowItem[]) => ReactNodeRenders the collapsed items, typically as a +N indicator. The callback receives each item's original child and index.
refRef<HTMLDivElement>Ref forwarded to the visible row.
styleCSSPropertiesInline styles applied to the visible row.