ClickorKeyboard shortcut Alt + L

Dragto resize

Nord Design System SearchDeveloperDeveloperGetting startedUsing Web ComponentsWebfontsCDNLocalizationCSS Framework Legacy ESLint PluginWorking with AIFAQDesignDesignGetting startedFoundationsAccessibilityColor SystemColor UtilitiesPrinciplesFigma ToolkitGridIconographyNamingNordhealth BrandTypographyThemesBrand assetsToolsComponentsComponentsAccordion New Aside New Autocomplete New AvatarBadgeBanner Updated ButtonButton GroupCalendar Updated Card Updated Chart New Checkbox Updated Collapsible New Combobox New Command MenuDate Picker Updated Date Range Picker New DividerDrawer Updated DropdownEmpty StateField New FieldsetFilter Bar New FooterHeaderIconInput Updated Input Group New Item New Kbd New LayoutMessageMeter New Modal Updated NavigationNotificationNumber Field New Otp Field New Outline New Overflow List New Pagination New Popout Updated ProgressProgress BarQrcodeRadio Updated Range Updated Resizable New Rich Text Editor New Scroll Area New Segmented ControlSelect Updated SkeletonSpinnerStackTabTableTagTextarea Updated Time Picker New Timestamp New ToastToggle Updated TooltipTop BarTruncate New Visually HiddenDesign TokensDesign TokensTailwind CSSTailwind CSSBlocksBlocksTemplatesTemplatesIconsIconsPlaygroundPlaygroundLatest UpdatesLatest UpdatesChangelogChangelogMigration guidesMigration guides
GitHub

Clickto expandKeyboard shortcut Alt + L

Overflow List New Alpha Light DOM & Tailwind

Open in Storybook

Keeps an ordered row within its available inline size and reports items that move into overflow.

This component is considered alpha. We're still finalising the API, so it may include a breaking change at any time — use it at your own risk.
Loading...

Usage

Overflow List measures ordered direct children and hides the contiguous items that no longer fit. It preserves every original element, listener, value, and DOM position while exposing visible and overflowed element/index pairs through read-only state and nord-overflow-change.

Importing the component registers its custom element:

import "@nordhealth/components/lib/OverflowList"
import "@nordhealth/components/lib/OverflowListCount"
import "@nordhealth/components/lib/OverflowListMenu"

Composition

Use the declarative nord-overflow-list-menu helper when hidden items are actions. It owns the Nord Dropdown affordance, mirrors the currently overflowed actions, and forwards activation to each original element without moving or cloning it. At its default width, the canonical example keeps Overview, Properties, and Edit visible while Duplicate and Share move into a +2 more menu.

State is available as immutable visibleItems and overflowItems arrays of { element, index } records. The read-only overflowCount is also reflected as data-overflow-count. nord-overflow-change bubbles and is composed, and fires only when an ordered classified set or original index changes. The Count and Menu helpers cover the common declarative integrations; a custom slot="overflow" affordance can synchronize equivalent content from the same event.

Examples

Collapse direction

The default collapse-from="end" keeps the earliest fitting items. collapse-from="start" keeps the latest fitting items. Classified arrays always remain in original order.

Because the light-DOM component never moves consumer content, place the overflow affordance at the matching logical edge in DOM order: last for end, first for start. This keeps visual and keyboard order aligned in LTR and RTL. The start-collapse example uses a five-step row: Step 1 and Step 2 move into +2 more, leaving Steps 3–5 visible.

Badge tags

When individual hidden tags are nonessential and a summary count is sufficient, nest nord-overflow-list-count compact inside a consumer-owned Nord Badge. The helper derives the live count from the nearest Overflow List, formats it for the active document language, and renders +N; without compact, it renders +N more. Set singular-label and plural-label so its accessible text describes the content, such as “1 more tag” or “2 more tags”. The resizable example uses Nord Badge variants for React, TypeScript, StyleX, Storybook, and Vitest.

Action rows need an equivalent interactive representation of every hidden action. Place nord-overflow-list-menu directly in the list with slot="overflow"; use compact for a +N toggle, or omit it for +N more. The resizable action example keeps Save, Edit, and Duplicate visible at its default width and moves Share, Archive, and Delete into a +3 Nord Dropdown. Menu activation forwards to the original action, preserving its listener and state.

Original click handlers

The built-in menu activates the original action with HTMLElement.click(), so direct and generated menu activation both run the listener attached to that original exactly once and its currentTarget remains the original element. The forwarded original click is programmatic, which means its isTrusted value is false.

If application behavior specifically requires a trusted event or cannot be represented by a forwarded click, provide a custom slot="overflow" affordance and synchronize it with nord-overflow-change instead. The resizable example lets you click Archive directly, resize until it moves into overflow, and choose Archive from the menu while a live output reports the handler count, current target, and trusted-event state.

Observation modes

observe="self" responds to the component’s actual assigned inline size. Use observe="parent" only when the containing element’s CSS content box is the relevant constraint. A Shadow DOM container can constrain slotted content internally—for example, with Card padding that is not visible on the host—so use the default self observation in that case. Both modes also respond to direct-child, content, item-size, affordance-size, font, and direction changes in one animation-frame batch.

Minimum visibility

Set min-visible-items to retain a required number of items. The minimum wins even if those items and the overflow affordance exceed the available inline size, so use it only for genuinely essential leading or trailing content.

Dynamic items

Items can be added, removed, reordered, or updated without recreating the component. Each change invalidates stale measurements and produces at most one classified-state event after the next stable layout.

Constrained containers

The gap defaults to Nord’s small spacing token. Choose none, xs, s, m, l, xl, or xxl, or set --n-overflow-list-gap when the surrounding product layout has a specific constraint.

State and events

  • visibleItems and overflowItems are immutable arrays of { element, index } records.
  • overflowCount is read-only and reflected as data-overflow-count, including 0.
  • nord-overflow-change bubbles and is composed. It fires only when an ordered classified set or original index changes.
  • nord-overflow-list-count handles locale-aware visible counts and accessible singular/plural labels for common count-only affordances.
  • nord-overflow-list-menu handles the common action-menu case, including equivalent menu items and activation forwarding.
  • For a custom slot="overflow" affordance, listen to nord-overflow-change as the custom integration escape hatch. Use its original element/index records to synchronize equivalent content, and supply translated labels through the product localization layer.

Accessibility

  • Overflowed originals are both hidden and inert, so their controls cannot remain in the tab order or accessibility tree.
  • Overflow List restores only attributes it added. Existing consumer hidden and inert state is preserved.
  • Use nord-overflow-list-menu for a keyboard-accessible equivalent of hidden actions, or provide a custom affordance with the same semantics and behavior.
  • The built-in menu keeps every generated action equivalent to its hidden original and forwards activation to that original, as shown in the Overview and Collapse from start examples.
  • Keep the affordance at the logical collapse edge in DOM order. CSS-only visual reordering would create a different keyboard order and is intentionally avoided.
  • Logical grid layout supports RTL, brand themes, high contrast, text resizing, and zoom without physical left/right assumptions.

API reference

OverflowList

Overflow List shows the contiguous set of direct child items that fits in the available inline size and exposes the remaining items to a consumer-owned overflow affordance.

<nord-overflow-list></nord-overflow-list>

Props

PropertyAttribute Description TypeDefault
collapseFromcollapse-fromLogical edge from which items collapse.OverflowCollapseFrom'end'
gapgapNord spacing token used between items.OverflowListGap's'
minVisibleItemsmin-visible-itemsMinimum number of items that remain visible, even when they do not fit.number0
observeobserveElement whose available inline size is observed.OverflowListObserve'self'

Slots

Slot name Description
Default slotOrdered items managed by the Overflow List.
overflowConsumer-owned affordance for access to overflowed content.
EventDetail TypeDescription
nord-overflow-changeOverflowListChangeEventDispatched when the visible or overflowed item set changes. The event exposes immutable visibleItems and overflowItems arrays containing each element and its original index.

CSS Properties

CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.

PropertyDescriptionDefault
--n-overflow-list-gapControls logical spacing between visible items and supplied overflow content.var(--n-space-s)
Light DOM & Tailwind. This component renders in the light DOM, so you can style it directly with your own CSS or Tailwind utility classes — there is no shadow boundary, and its default styles are low specificity, so your utilities win.

Parts

This component is made up of the following parts.

Overflow List Count

Displays the number of items currently hidden by the nearest Overflow List.

<nord-overflow-list-count></nord-overflow-list-count>

Props

PropertyAttribute Description TypeDefault
compactcompactShows only the signed count visually while keeping the full accessible phrase.booleanfalse
singularLabelsingular-labelNoun used by the accessible phrase when exactly one item is hidden.string | undefined
pluralLabelplural-labelNoun used by the accessible phrase when multiple items are hidden.string | undefined

Overflow List Menu

Provides a declarative menu for actions hidden by the nearest Overflow List.

<nord-overflow-list-menu></nord-overflow-list-menu>

Props

PropertyAttribute Description TypeDefault
sizesizeSize passed to the owned Nord Dropdown and Button.OverflowListMenuSize'm'
compactcompactShows only the signed count inside the owned toggle.booleanfalse
singularLabelsingular-labelNoun used when exactly one item is hidden.string | undefined
pluralLabelplural-labelNoun used when multiple items are hidden.string | undefined
Design guidelinesFor designers

Usage

This section includes guidelines for designers and developers about using this component in different contexts.

Do

  • Use Overflow List for one ordered row of actions, filters, breadcrumbs, or compact metadata that must adapt to its available inline size.
  • Place custom slot="overflow" content at the DOM end for collapse-from="end" and at the DOM start for collapse-from="start", so visual and keyboard order agree.
  • Use nord-overflow-list-menu for the common action-menu case; it mirrors overflowed actions and forwards activation to their originals.
  • For non-interactive, nonessential overflow where a summary is sufficient, nest nord-overflow-list-count inside a Badge or another suitable affordance to show a locale-aware +N more, or use compact for +N.
  • Set singular-label and plural-label on either helper so its accessible label identifies the hidden content.
  • Listen for nord-overflow-change and use its original element/index pairs when a product needs a custom overflow affordance.
  • Provide an equivalent keyboard-accessible representation whenever hidden items are actionable or essential.

Don’t

  • Don’t rebuild the standard count or action-menu behavior in setup scripts when the declarative helpers cover it.
  • Don’t move or recreate items in response to the change event. The original elements remain in place and return when space is available.
  • Don’t set min-visible-items higher than the layout can reasonably accommodate unless deliberate host overflow is acceptable.

Observation

The default observe="self" mode measures the component’s actual assigned inline size. Use observe="parent" only when the containing element’s CSS content box owns the relevant constraint. If a Shadow DOM container constrains slotted content internally—for example, with Card padding that is not reflected by its host—keep the default self observation. Direct-child additions, removals, reordering and content changes, item or affordance resizes, font loading, direction changes, and observed-size changes are batched into the next animation frame.

The gap values use Nord spacing tokens. --n-overflow-list-gap is available for a product-specific spacing constraint.

Accessibility

Overflowed originals receive component-owned hidden and inert state, which removes their interactive descendants from the tab order and accessibility tree. When an item fits again, or the component disconnects, only state added by Overflow List is removed; consumer-owned hidden or inert attributes remain intact.

The base component does not create a default interactive affordance. If hidden items contain actions, use nord-overflow-list-menu as the direct slot="overflow" child. For non-interactive count-only content, nest nord-overflow-list-count inside the consumer-owned overflow Badge or another suitable affordance. A count alone is not an equivalent replacement for hidden actions. Keep the affordance at the logical collapse edge in DOM order so keyboard navigation matches the visual row in both LTR and RTL layouts.

Both helpers format the count for the active locale. Without compact, the visual label is +1 more or +2 more; compact Badge and menu affordances use +N. Their singular-label and plural-label attributes keep the accessible label equally specific. The canonical Overview, Badge Tags, Dropdown Actions, and Collapse From Start stories cover these declarative patterns.

Raw consumer-owned slot="overflow" content remains available as an escape hatch. Listen for nord-overflow-change when a custom affordance must synchronize different content or behavior, and use the event’s original element/index pairs without moving or recreating the originals.