Import
import { List } from '@dnb/eufemia'
Description
List is a layout component for displaying rows of content. Use List.Container as the wrapper and List.Item.Basic, List.Item.Action, or List.Item.Accordion for each row.
- List.Container – Provides list context (e.g. variant) and wraps items in a vertical flex layout. Pass
separatedto insert gap between rows so each item gets its own rounding/outline instead of sharing borders. - List.Item.Basic – A single row with optional
iconandtitleprops and cell children. Supports selected state, variant override, and loading states viapending(skeleton overlay) orskeleton(text placeholder). - List.Item.Action – Clickable row with optional
iconandtitleprops (Enter/Space support) and a chevron icon. UsechevronPosition="left"or"right"(default) to place the chevron. Supportspendingto show a loading overlay and disable interaction. Usehreffor navigation. - List.Item.Accordion – Expandable row with optional
iconandtitleprops andList.Item.Accordion.Contentfor the expandable section. Useopenfor initial state,chevronPosition="left"or"right"(default) for chevron placement, and optionalidfor ARIA. Supportspendingto disable toggling. - List.Cell.Start, List.Cell.Center, List.Cell.End, List.Cell.Footer – Cell slots inside Basic/Action/Accordion for start, middle, end, and additional content.
- List.Cell.Title – Title block that can contain
List.Cell.Title.OverlineandList.Cell.Title.Subline. Use the nested helpers for structured header text, even though the drop-inList.Cell.Title.Overline/List.Cell.Title.Sublinecomponents still exist for backward compatibility.
All item components support Space props (top, bottom, etc.) and forward standard HTML attributes.
Relevant links
Basic usage
import { List } from '@dnb/eufemia'render(<List.Container><List.Item.Basic>Simple row</List.Item.Basic><List.Item.Basic title="Title" icon="bell"><List.Cell.Start>Start</List.Cell.Start><List.Cell.Center>Center</List.Cell.Center><List.Cell.End>End</List.Cell.End></List.Item.Basic><List.Item.Basic><List.Cell.Center><List.Cell.Title><List.Cell.Title.Overline>Overline</List.Cell.Title.Overline>Main title here<List.Cell.Title.Subline>Subline</List.Cell.Title.Subline></List.Cell.Title></List.Cell.Center></List.Item.Basic><List.Item.Actiontitle="Click me"icon="bell"onClick={() => console.log('Clicked')}><List.Cell.End>Value</List.Cell.End></List.Item.Action><List.Item.Actiontitle="Link"icon="bell"href="https://dnb.no"target="_blank"rel="noopener noreferrer"><List.Cell.End>Value</List.Cell.End></List.Item.Action><List.Item.Accordion title="Expandable" icon="bell"><List.Item.Accordion.Header><List.Cell.End>1234</List.Cell.End></List.Item.Accordion.Header><List.Item.Accordion.Content><P>Content when expanded.</P></List.Item.Accordion.Content></List.Item.Accordion><List.Item.Accordion title="Without explicit header" icon="bell"><List.Item.Accordion.Content><P>Content when expanded.</P></List.Item.Accordion.Content></List.Item.Accordion></List.Container>)
Loading states
- pending – On
List.Item.BasicorList.Item.Action: shows a skeleton overlay and disables pointer events. OnList.Item.Action, click and keyboard are disabled (tabIndex={-1},aria-disabled). Use while data is loading. - skeleton – On
List.Item.BasicorList.Item.Action: applies skeleton font styling (text placeholder) without the full overlay. Use for a lighter loading indication.
Accessibility
- List.Item.Action uses
role="button"so assistive technologies announce it as a button. It is focusable (tabIndex={0}) and activates on Enter and Space. Whenpendingis true, it is not focusable and hasaria-disabled="true". You can override the role via theroleprop (e.g.role="link"). - List.Item.Accordion exposes full ARIA for expand/collapse: the header has
id,aria-controls, andaria-expanded; the content region hasid,aria-labelledby,aria-hidden, andaria-expanded. Pass anidprop for stable references, or leave it unset for an auto-generated id. Whenpendingis true, the header is not focusable and hasaria-disabled="true". - Use
aria-labelor other ARIA attributes on the container or items when needed for screen readers.