# List Panel

A dashboard card with a titled list: 31 ready panels (transactions, orders, integrations, team, activity, crypto, timelines …) with loading, empty and error states, or your own rows.

- Category: Data & Tables
- Page: https://wunderui.com/components/list-panel
- Tier: Core and Pro

## Install

List Panel ships with WunderUI Core and Pro in the @wunderui/react package.

## Import

```tsx
import { ListPanel, ListPanelPreset, ListPanelProps, ListPanelSkeleton, ListPanelState, ListPanelVariant } from "@wunderui/react"
```

## Minimal usage

Then use it:

```tsx
import { ListPanel } from "@wunderui/react"

export function Transactions() {
  return (
    <ListPanel
      title="Recent transactions"
      description="Last 7 days"
      action="View all"
      items={[
        { id: "nora", title: "Nora Lindgren", description: "WunderUI Pro, one-time", trailing: { type: "value", value: "+$299.00", sub: "Today" } },
        { id: "daniel", title: "Daniel Okafor", description: "WunderUI Core, one-time", trailing: { type: "value", value: "+$199.00", sub: "Yesterday" } },
      ]}
    />
  )
}
```

Expected result: You see one bordered card titled Recent transactions with a View all link at the right and two rows, each with an amount on the right.

## When to use

### Use List Panel for

- A dashboard card with a titled list: recent transactions, orders, activity, approvals
- A list that can be loading, empty or failed and must say so
- A list with a View all link in the header or a button in the footer

### Use something else

- [List Group](https://wunderui.com/components/list-group) for a card of rows that people select, switch, open, reorder or discuss
- [Data Table](https://wunderui.com/components/data-table) for many rows that people sort, filter or compare by column

## Keyboard

The panel handles no keys itself. Every control in it is a native button, so the browser handles focus and activation.

| Key | Action |
|---|---|
| `Tab` or `Shift+Tab` | Moves focus through the header action, the pressable rows and their controls in order, and then the footer button. In the empty and error states it reaches their button. Static rows are skipped. |
| `Enter` or `Space` | Presses the focused button: a row with `onItemSelect`, the header action, the footer button, Try again or the empty state's button. |
| `Enter` or `Space` or `ArrowDown` | Opens the menu of a row's trailing icon button. Inside the menu the arrow keys move, Enter picks and Escape closes it. |
| `Tab` | Reaches a scrolling region of your own only when it has `tabIndex={0}`: add it when the rows inside are static, so people can scroll with the arrow keys. |

Arrow keys do not move between rows. A row is a tab stop only when it can be pressed or holds a control.

## Behavior

What the panel does with state, content, the DOM and motion.

- **Four states:** A panel is ready, loading, empty or error, and a ready panel with no rows shows the empty state. The header always stays; loading hides the action and footer, empty and error hide the footer.
- **Loading keeps the shape:** Loading draws skeleton rows with the same padding and dividers, one per real row by default, so the card keeps its height. Screen readers hear Loading and the title.
- **Empty and error:** Both show a centred round icon, a message and a button. Empty is a status and error an alert, and Try again appears only when you pass a retry handler.
- **Variants and your own rows:** A variant sets the title, action, dividers, loading shape and empty and error copy, with sample rows until you pass items. Anything you pass yourself wins.
- **Rows:** Rows are static unless they have their own select handler or link. Pass one item handler and every row becomes a button that receives its data.
- **No scroll region:** The card grows with its rows. For a fixed height, give it a height class and pass your own scrolling region as children; header and footer stay put.
- **Names for assistive technology:** The panel is a section named by its title. The rows form a list with the same name, and each row's controls are named by the row title.
- **Motion and reduced motion:** Rows fill and press quickly and the dividers fade. With reduced motion only colour and opacity change, and the four states swap without animation.

## Anatomy

- `ListPanel`: The card: a section 400 px wide (it shrinks on a narrow screen) with a 1 px border, 16 px radius, card surface, 16 px padding and 16 px between parts. A title names it for assistive technology.
- `Header`: The row above the rows. It shows when the panel has a title or an action, and the action is hidden while the panel loads.
- `Title and description`: The title as a heading (h3 by default, 16 px semibold) with the description under it in 12 px secondary text.
- `Action`: The action at the right of the header. A string becomes a link button, an element is placed as it is.
- `ListItems`: The rows. The list sits 8 px outside the card padding, so row text lines up with the title and the hover fill keeps a concentric 8 px radius inside the 16 px card.
- `Footer`: The footer under the rows: a string becomes one full-width plain button, an element is placed as it is. It shows only while the panel is ready.
- `ListPanelSkeleton`
- `Skeleton Row`
- `Header`
- `Footer`
- `State`

## Best practices

### When to use

- Use a List Panel for a dashboard card that lists recent things: transactions, orders, activity, approvals. Header, footer and all four states come with it.

### Do

- Start from a variant and pass your own items. The variant sets the title, dividers and the empty and error copy, so the panels of a dashboard stay alike.
- Pass a retry handler to give the error state a Try again button, and an action handler when the empty state's button should do something.
- Keep the panel's height while data loads. Loading draws as many skeleton rows as there are rows, so nothing jumps.
- Write an error message that says what failed and what to do, for example: We could not load the transactions. Check your connection and try again.

### Don't

- Don't put more than a handful of rows in a panel without a fixed height. Give the card a height and a scrolling region, or link to the full list.
- Don't hide a failed load behind an empty list. Empty means there is nothing to show; a failed load needs the error state.
- Don't change the card padding by hand. It matches every chart card at 16 px, and the rows need it for their concentric radius.

## API reference

### ListPanel

| Prop | Type | Default | Description |
|---|---|---|---|
| action | React.ReactNode \| false |  | The header action. A string draws a link Button, an element is placed as it is and `false` hides the action of a variant. |
| density | "compact" \| "comfortable" | "comfortable" | `comfortable` gives rows 12 px of vertical padding, `compact` 8 px. |
| description | React.ReactNode |  | A line under the title in 12 px secondary text. |
| divider | boolean |  | Whether a 1 px line separates the rows. Without it the rows sit 4 px apart. It defaults to the variant's. |
| empty | { icon, title, description, action } |  | The empty state: a round icon, a title, a description and a button. A string `action` draws a plain Button that calls `onEmptyAction`. |
| error | { title, description } |  | The text of the error state. It defaults to the variant's, or to Couldn't load this list. |
| footer | React.ReactNode |  | Under the rows, shown while ready. A string draws one full-width plain Button, an element is placed as it is. |
| items | ListItemData[] |  | The rows. With a variant and no items the sample rows show; an empty array shows the empty state. |
| loadingRows | number |  | How many skeleton rows to draw while loading. It defaults to the number of rows, so the card keeps its height. |
| onAction | () => void |  | Called when the string action is pressed. |
| onEmptyAction | () => void |  | Called when the empty state's string action is pressed. |
| onFooterAction | () => void |  | Called when the string footer is pressed. |
| onItemSelect | (item: ListItemData) => void |  | Makes every row one button and calls this with the row's data. Rows with their own `onSelect` or `href` keep them. |
| onRetry | () => void |  | Adds a Try again button to the error state and calls this when it is pressed. |
| skeleton | "circle" \| "square" |  | The shape of the leading placeholder while loading: `circle` or `square`. It defaults to the variant's. |
| state | "error" \| "loading" \| "empty" \| "ready" | "ready" | `ready` shows the rows, `loading` skeleton rows, `empty` the empty state and `error` the error state. |
| timeline | boolean |  | Draws the 2 px connector behind the step circles of the Timeline variants. |
| title | React.ReactNode |  | The heading in the header, `h3` by default, in 16 px semibold. It names the panel for assistive technology. |
| titleAs | "h2" \| "h3" \| "h4" \| "h5" \| "h6" | "h3" | The heading level of the title, `h2` to `h6`. It defaults to `h3`. |
| variant | "recent-transactions" \| "recent-orders" \| "invoices" \| "connected-integrations" \| "team-members" \| "activity-feed" \| "notifications" \| "upcoming-events" \| "tasks-approvals" \| "files-documents" \| "uploads-sync-jobs" \| "top-products" \| "top-customers" \| "audience-by-location" \| "traffic-sources" \| "revenue-by-channel" \| "subscriptions" \| "support-tickets" \| "crypto-portfolio" \| "crypto-transactions" \| "crypto-watchlist" \| "staking-rewards" \| "account-activity" \| "system-activity" \| "project-timeline" \| "order-timeline" \| "customer-timeline" \| "release-timeline" \| "integration-directory" \| "integration-sync-status" \| "available-modules" |  | One of 31 ready panels, for example `recent-transactions`, `team-members` or `project-timeline`. It sets the title, description, action, dividers, the copy of the empty and error states and sample rows. |

Also accepts React.HTMLAttributes attributes.

### ListPanelSkeleton

| Prop | Type | Default | Description |
|---|---|---|---|
| contentHeight | number | 38 | The height of the text block of a row in px: 38 for two lines, 44 for a value with a badge, 48 for a date tile, 56 for three lines. |
| density | "compact" \| "comfortable" | "comfortable" | The row padding, as in the real list. |
| divider | boolean | true | Whether the rows have dividers, as in the real list. |
| rows | number | 4 | How many skeleton rows to draw. It defaults to 4. |
| shape | "circle" \| "square" | "circle" | The shape of the leading placeholder: `circle` or `square`. |

## Examples

### Panels: six of the 31 variants

### Action: link, icon button or none

### Footer: none, button or custom

### Layout: comfortable, compact and without dividers

### Rows: static or pressable

### State: ready, loading, empty and error

### Height: fits or scrolls

## In context

### Transactions: loading, ready and a failing server

The panel loads for a moment. With the server set to Fails it shows the error state and Try again asks again; Reset starts over.

### Team: search with an empty state

The search field filters the rows. With no match the panel shows its empty state, and Clear search brings the rows back.

### Notifications: mark as read

Pressing a row clears its dot, and the footer marks every row. When nothing is unread the footer goes away.

### Approvals: approve until nothing is left

Approve takes the request out of the panel. When the last one is gone, the empty state appears.

## For AI agents

`get_component("list-panel")`

Hand your agent this page as Markdown or the WunderUI MCP server, not a screenshot.
