Bridge UI

List

Vertical list container with items and sections.

Introduction

Lists present a continuous, vertical index of text or images. They are composed of related parts:

  • List — wrapper for rows; renders as ul, ol, or nav via the as prop.
  • ListItem — a single row with primary and optional secondary text, plus start and end slots.
  • ListSection — a subheader that groups related items.

List vs Menu content: A List is part of the document flow—side navigation, settings screens, or static indexes. A Menu is a temporary floating surface anchored to a trigger; its panel often contains a List of ListItem rows using role="menuitem". Items and sections use compact inset rounded highlights. Use List for persistent layout; wrap it in Menu when choices should appear on demand and dismiss after selection.

List vs Table: A List is a vertical index of items. A Table aligns values across columns—rosters, invoices, and other tabular data. Use DataTable when that grid also needs sort, selection, filters, or pagination.

Import

import { List } from "@bridge-ui/vue/Components/List";
import { ListItem } from "@bridge-ui/vue/Components/ListItem";
import { ListSection } from "@bridge-ui/vue/Components/ListSection";
import { List } from "@bridge-ui/react/Components/List";
import { ListItem } from "@bridge-ui/react/Components/ListItem";
import { ListSection } from "@bridge-ui/react/Components/ListSection";

Basic usage

Wrap ListItem rows inside a List. Use primary and secondary for label text.

Sections

Use ListSection to add subheaders that group related items. Keep items as siblings of ListSection, not nested inside it. Add leading and trailing content to items with the start and end slots.

With the default as="li", sticky applies on the section root (with an opaque background) so the heading can stick while sibling items scroll. Use as="div" when you need sticky on the title element itself. The list (or a parent) needs a scroll container with a constrained height.

Interactive items

Set interactive on ListItem to apply hover and focus styles. Use selected to highlight the active row and customProps.interactive (React) or custom-props (Vue) to handle clicks.

Selected icon

Selected rows show a check icon by default. Customize it with selectedIcon on ListItem, or pass null to hide it. Providing slots.end replaces the selected icon.

Set href to render the row as an anchor. The browser shows the URL on hover, and middle-click opens a new tab. target and rel are forwarded to that anchor. linkAs replaces that anchor and leaves the row root as as (li or div). linkProps is checked against linkAs and forwarded to it. interactive is implied, and role is omitted. A disabled item keeps the styles and drops the URL.

<List>
  <ListItem href="/inbox" primary="Inbox" />
  <ListItem href="/drafts" primary="Drafts" />
  <ListItem disabled href="/archive" primary="Archive" />
</List>

Dense

Pass dense to the List to reduce vertical spacing on child items and sections.

DataTable, Menu, Select, Sidebar, Table

Accessibility

  • Set as="nav" on List when it represents site or section navigation.
  • On interactive rows, set interactive so hover and focus styles apply and tabIndex={0} is added. href implies that and renders an anchor.
  • When items appear inside a Menu, set role="menuitem" on ListItem (or "option" inside a listbox pattern).
  • Use selected to highlight the active item; pair with visible focus styles for keyboard users.
  • Set disabled on non-actionable rows so they are skipped or muted appropriately.

Anatomy

<ul> <!-- List root -->
  <li> <!-- ListSection -->
    <div> <!-- section title -->
  </li>
  <li> <!-- ListItem -->
    <div> <!-- start slot -->
    <div> <!-- content (primary + secondary) -->
    <div> <!-- end slot -->
  </li>
</ul>

Use classes on each component to style list, item, and section parts independently.

API

List

Prop Type Default Description
as "nav" | "ol" | "ul" "ul" The element to render as.
classes ListClasses — Classes for the list root.
customProps ListCustomProps — Props forwarded to list parts.
dense boolean false Compact vertical spacing on child items and sections.
nested boolean false Indents the list for nested navigation.

ListItem

Prop Type Default Description
as "div" | "li" "li" The element to render as.
classes ListItemClasses — Classes for item parts.
customProps ListItemCustomProps — Props forwarded to item parts, including interactive for click handlers.
dense boolean — Compact padding. Inherits from parent List when omitted.
disabled boolean false Mutes the item and disables interaction.
divider boolean false Renders a bottom divider.
href string — URL for the interactive wrapper. Renders an anchor so hover shows the address and middle-click opens a new tab. When linkAs is set, this also accepts that component’s href.
interactive boolean false Applies hover/focus styles and tabIndex={0}. Implied when href is set.
linkAs ElementType — Component rendered in place of the interactive anchor. Vue also accepts a string tag. The root stays as. Ignored while disabled.
linkProps props of linkAs — Props forwarded to linkAs. Checked against that component. Ignored while linkAs is not rendered.
primary ReactNode — Primary label text. A string primary is the closed-trigger label inside Select / Autocomplete.
rel string — Relationship of the linked URL. Forwarded to the anchor when href is set.
role "button" | "menuitem" | "option" "button" ARIA role for the interactive wrapper. Omitted when href is set.
secondary ReactNode — Secondary text below the primary line.
selected boolean false Highlights the item as selected.
selectedIcon null | IconSource "check" Icon shown when selected is true. Use null to hide it. Replaced by slots.end.
slots ListItemSlots — React slots: start, end, primary, secondary. Vue slots: #start, #end.
target string — Where to open the URL. Forwarded to the anchor when href is set.
value ListboxValue — When set inside a Select / Autocomplete / Listbox, registers this row as a selectable option.

ListSection

Prop Type Default Description
as "div" | "li" "li" The element to render as.
classes ListSectionClasses — Classes for section parts.
customProps ListSectionCustomProps — Props forwarded to section parts.
inset boolean false Adds left padding to align with items that have leading icons.
sticky boolean false Sticks the heading while scrolling. On as="li" (default), sticky + opaque background apply to the root; on as="div", to the title.
title ReactNode — Section label text.