Skip to content

List group ​

The list of rows that is not a table. Each row renders the element that matches what it does.

Open in demo
Open in demo

Usage ​

SaListGroup is the container, SaListGroupItem is a row. The container renders a <ul>, or an <ol> with ordered when the order carries meaning, and each item renders an <li>.

The point of the item is that it renders the right element rather than a <div> with a click handler:

You passIt rendersWhy it matters
toRouterLinkMiddle-click and open-in-new-tab work.
href<a>The same, for an external URL.
clickable<button>An action, not navigation, so Enter and Space both fire it.
none of them<div>Plain content, with no hover or focus affordance.

Only the interactive forms get the hover tint and the focus ring, so a list of read-only rows does not pretend to be clickable.

Examples ​

target="_blank" also sets rel="noopener noreferrer". disabled dims the row, blocks pointer events, sets aria-disabled, and on a button form sets disabled as well.

Leading, trailing and active ​

leading and trailing hold an icon, a badge, a switch or a chevron. active tints the row and sets aria-current.

Flush, inside a card ​

variant="flush" drops the border, background and radius and keeps only the dividers, for a list that already sits in a card.

API ​

Source: src/shared/components/common/list/

SaListGroup props ​

PropTypeDefaultDescription
variant'default' | 'flush''default'default is its own bordered card. flush is dividers only.
orderedboolean—Renders <ol> instead of <ul>.

SaListGroup slots ​

SlotDescription
defaultThe items.

SaListGroupItem props ​

PropTypeDefaultDescription
titlestring—The first line, used when the default slot is empty.
descriptionstring—The second line, used when the default slot is empty.
tostring—An internal route. Renders a RouterLink.
hrefstring—An external URL. Renders an <a>.
targetstring—The anchor target. _blank also sets rel="noopener noreferrer".
clickableboolean—Renders a <button>.
activeboolean—Tints the row and sets aria-current.
disabledboolean—Dims the row, blocks pointer events, sets aria-disabled.

SaListGroupItem emits ​

EventPayloadDescription
clickevent: MouseEventFires on any form of the row.

SaListGroupItem slots ​

SlotDescription
defaultReplaces the title and description block.
leadingBefore the text. Does not shrink.
trailingAfter the text. Does not shrink.

Accessibility ​

  • The container is a real list, so a screen reader announces how many rows there are.
  • An interactive row is a link or a button, so it is reachable by Tab and fires on the key its element fires on, with no role or tabindex patched on.
  • active sets aria-current, and disabled sets aria-disabled as well as the native disabled on a button.
  • The focus ring is drawn inside the row, so it is not clipped by the container's rounded corners.
  • Both text lines truncate rather than wrap, so a long value cannot push the trailing control out of the row.