Can we move the launch review to Thursday? The pricing page still needs a final pass.
List Group
A 400 px card of list rows with an optional header — sixteen ready patterns: basic, icon, avatar, brand, metric, selectable, toggle, sortable, expandable, grouped, ranking, comparison, tree, action, discussion and master–detail.
See alsoList ItemList Panel
Usage
Installation
List Group comes with WunderUI Core and Pro, in the package from your plan. See the plans.
Then import what you need:
import {
ListGroup,
ListGroupActions,
ListGroupActionsProps,
ListGroupDetails,
ListGroupDetailsProps,
ListGroupDiscussion,
ListGroupDiscussionProps,
ListGroupExpandable,
ListGroupExpandableItem,
ListGroupExpandableProps,
ListGroupHeader,
ListGroupHeaderProps,
ListGroupMasterDetail,
ListGroupMasterDetailItem,
ListGroupMasterDetailProps,
ListGroupProps,
ListGroupSection,
ListGroupSectionProps,
ListGroupSelectable,
ListGroupSelectableItem,
ListGroupSelectableProps,
ListGroupSortable,
ListGroupSortableItem,
ListGroupSortableProps,
ListGroupToggle,
ListGroupToggleItem,
ListGroupToggleProps,
ListGroupTree,
ListGroupTreeProps,
} from "@wunderui/react"Examples
Basic List
Title, description and a chevron. Each row is a button that selects; the divider runs under every row but the last.
Icon List
A tinted icon tile, title, description and a plain button per row.
Avatar List
Tint initials avatars, name, role or email and a status badge; the header carries the count.
Brand List
Integration logos with their connection status; Connect connects, Manage opens the settings.
Metric List
A metric per row: value, the previous value and the change as a trend chip.
Selectable List
One radio per row in a radio group; click anywhere on the row or use the arrow keys. mode="checkbox" allows several.
Toggle List
Icon tile, label, explanation and a switch; the whole row toggles it, the last row is disabled.
Sortable List
Drag a row by its handle, press Alt with an arrow key on the handle, or use Move up and Move down in the row menu. Each move is announced.
Expandable List
Every row is a disclosure button; the open row shows its details and actions under it.
Grouped List
Sections with a heading and a count badge; the first row shows the unread dot until you open it.
Ranking List
Rank, value and the change in position as a trend chip.
Comparison List
Current value, the value it is compared with and the difference.
Tree List
Nested folders indented 20 px per level. Arrow keys move, Right opens, Left closes or goes up, Enter selects.
Action List
A menu of actions with icons, descriptions and shortcuts; the destructive action is set in text-error.
Discussion List
Comments with author, time, a like that toggles, replies that show and hide, and a reply composer.
Master-Detail List
Choosing a conversation opens it beside the list (400 px list + detail). Arrow keys move through the inbox; Resolve and Reply work.
Anatomy
The parts the component is made of. Each one renders a you can target from CSS.
- data-slot="list-group"
The 400 px card (16 px radius, 8 px padding) with an optional header and rows from or children. Basic, icon, avatar, brand, metric, ranking and comparison lists are this card with different slots.
- data-slot="list-group-header"
Title, optional description, count badge or link action at the top of the card.
- data-slot="list-group-section"
A labelled run of rows inside a group, with a count badge (Today 3, Yesterday 2).
- data-slot="list-item"
A row inside the special groups; the same row as List Item.
- data-slot="list-item-row"
The rounded surface of such a row.
- data-slot="list-row-click-area"
A layer under the controls that lets a click anywhere on a selectable or toggle row reach its control.
A command menu (): icon, title, description and a Kbd shortcut per action; one tab stop, arrow keys and typeahead.
Comments with author and time, a like that toggles, replies that show and hide, and an inline reply composer.
- data-slot="list-comment"
One comment of the discussion: avatar, author, time, text and the reaction buttons.
- data-slot="list-thread"
A comment with its replies; threads are divided by a hairline.
Rows that are disclosure buttons; the open row shows its details below. One open at a time unless .
- data-slot="list-group-details"
The detail box an expandable row opens: label and value pairs on a subtle surface, then actions.
- data-slot="list-group-master-detail"
An inbox-style listbox on the left and the detail of the chosen row on the right; stacks below 720 px.
A checkbox or radio per row, controlled with or uncontrolled; a click anywhere on the row toggles it.
Rows with drag handles. Drag with a pointer, press Alt with an arrow key, or use Move up and Move down in the row menu; every move is announced.
A switch per row; the row toggles it, and disabled rows stay readable at half opacity.
Nested folders and items in a , indented 20 px per level, with the full arrow-key pattern.
Best practices
- When to use
Use a List Group for a self-contained list in a settings page, a sidebar or next to a chart: a few rows under one heading. For a dashboard card with loading and empty states, use a List Panel.
- Do
Choose the group by what people do with the rows: pick (Selectable), switch (Toggle), reorder (Sortable), open (Expandable, Tree, Master–Detail) or run (Action).
- Do
Keep a group to about five to eight rows and link to the full list with the header action.
- Do
Name every group with a title or ; the lists, trees and menus inside take their accessible name from it.
- Don’t
Don't mix dividers and no dividers in one group. Lists with figures and states get dividers; feeds, rankings and timelines go without.
- Don’t
Don't rely on drag alone. Sortable already offers Alt with the arrow keys and the row menu, so keep the handle visible.
API Reference
Theming
The CSS variables this component reads. Set one on any wrapper to restyle everything inside it. More in Theming.