Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

List page

A toolbar with search and filters over a list and detail split.

Brightwell Legal

Contract workflowq-2041Ramzi

Lines
Audit and scoping €1,800
Build the first module €6,000
Handover €1,200
Total €9,000
Pick a quote
Its lines and total open here.
No quote matches
Clear the filter to see every quote.
No quotes yet

Installation

pnpm add @heyramzi/ui

Usage

import {
  DetailHeader,
  DetailPanel,
  DetailRow,
  DetailStack,
  EmptyState,
  FilterItem,
  FilterPopover,
  filterSectionClass,
  ListPageShell,
  MasterDetail,
  RailBody,
  RailHead,
  RailRow,
  ToolbarSearch,
} from "@heyramzi/ui/components/list-page";
<ListPageShell>
  {#snippet content()}
    <MasterDetail>
      {#snippet rail()}
        <RailBody>
          {#each quotes as quote (quote.id)}
            <RailRow title={quote.client} onclick={() => (selectedId = quote.id)} />
          {/each}
        </RailBody>
      {/snippet}
      {#snippet detail()}
        <DetailHeader title={selected.client} />
      {/snippet}
    </MasterDetail>
  {/snippet}
</ListPageShell>

Keyboard and accessibility

Key Does
Tab Moves through the toolbar, the rows, then the open record.
Space Enter On a row, opens its record.
Arrow Down Arrow Up In a filter menu, moves through its options. Space or Enter checks one and the menu stays open.
Esc Closes a filter menu and returns focus to its button.
Arrow Down Arrow Up Home End In a GroupedList, moves between the group headers. Space or Enter folds or unfolds one.
  • Rows are buttons, and the open one reports itself as current.
  • A filter button opens a menu, and each option reports checked.
  • A GroupedList header reports open or closed and points at the rows it folds.
  • The filter tabs are a named group of radio buttons. Arrows move between them, and the picked one reports checked.
  • The search field has only its placeholder for a name.
  • Under 1024px wide, the list and the record take turns. Picking a row moves focus into the record, and the back button returns it to that row.
  • With reduced motion on, the list-to-record slide doesn't play.

API reference

ListPageShell

isEmpty boolean
Default false
emptyState EmptyConfig
hideToolbarWhenEmpty boolean
Default false
maxWidth string | false
Default "1600px"
fillHeight boolean
Default false
containerClass string
toolbarClass string
tabs Snippet
search Snippet
filters Snippet
rightActions Snippet
summary Snippet
content Snippet
empty Snippet
extra Snippet
searchLabel string
Default "Search"
The folded search icon's name, on a toolbar too narrow for the field. Translate at the call site.
closeSearchLabel string
Default "Close search"
The close button's name once the folded search is open.
Prop Type Default
isEmpty boolean false
emptyState EmptyConfig
hideToolbarWhenEmpty boolean false
maxWidth string | false "1600px"
fillHeight boolean false
containerClass string
toolbarClass string
tabs Snippet
search Snippet
filters Snippet
rightActions Snippet
summary Snippet
content Snippet
empty Snippet
extra Snippet
searchLabel

The folded search icon's name, on a toolbar too narrow for the field. Translate at the call site.

string "Search"
closeSearchLabel

The close button's name once the folded search is open.

string "Close search"

ToolbarSearch

value bindable string
Default ""
placeholder string
Default "Search..."
label string
Default "Search"
The box's accessible name. A placeholder isn't one, and it goes away once you type.
size "sm" | "default"
Default "default"
class string
Prop Type Default
value bindable string ""
placeholder string "Search..."
label

The box's accessible name. A placeholder isn't one, and it goes away once you type.

string "Search"
size "sm" | "default" "default"
class string

FilterPopover

label required string
icon PhosphorIcon
Default DefaultFunnelIcon
count number
Default 0
active boolean
onClear () => void
align "start" | "center" | "end"
Default "start"
width `w-${string}`
Default "w-52"
open bindable boolean
Default false
clearLabel string
Default "Clear"
triggerClass string
contentClass string
children required Snippet
trailing Snippet
Prop Type Default
label required string
icon PhosphorIcon DefaultFunnelIcon
count number 0
active boolean
onClear () => void
align "start" | "center" | "end" "start"
width `w-${string}` "w-52"
open bindable boolean false
clearLabel string "Clear"
triggerClass string
contentClass string
children required Snippet
trailing Snippet

FilterItem

checked required boolean
onclick required () => void
variant "checkbox" | "radio"
Default "checkbox"
children required Snippet
Prop Type Default
checked required boolean
onclick required () => void
variant "checkbox" | "radio" "checkbox"
children required Snippet

MasterDetail

rail required Snippet
detail required Snippet
banner Snippet
railWidth string
Default "minmax(260px, 320px)"
stackBelow "lg" | "xl"
Default "lg"
backLabel string
Default "Back to the list"
pane bindable "rail" | "detail"
Default "rail"
gap boolean
Default true
pad boolean
Default true
railClass string
detailClass string
class string
Prop Type Default
rail required Snippet
detail required Snippet
banner Snippet
railWidth string "minmax(260px, 320px)"
stackBelow "lg" | "xl" "lg"
backLabel string "Back to the list"
pane bindable "rail" | "detail" "rail"
gap boolean true
pad boolean true
railClass string
detailClass string
class string

RailHead

label string
action Snippet
children Snippet
class string
Prop Type Default
label string
action Snippet
children Snippet
class string

RailBody

children required Snippet
class string
Prop Type Default
children required Snippet
class string

RailRow

title required string
selected boolean
Default false
onclick required () => void
leading Snippet
trailing Snippet
preview string | null
meta Array<string | null | undefined | false>
metaTruncate "first" | "last"
Default "first"
metaTrail Snippet
actions Snippet
titleLines 1 | 2
Default 1
class string
Prop Type Default
title required string
selected boolean false
onclick required () => void
leading Snippet
trailing Snippet
preview string | null
meta Array<string | null | undefined | false>
metaTruncate "first" | "last" "first"
metaTrail Snippet
actions Snippet
titleLines 1 | 2 1
class string

DetailStack

fill boolean
Default false
children required Snippet
class string
Prop Type Default
fill boolean false
children required Snippet
class string

DetailHeader

title required string
badge Snippet
leading Snippet
meta Array<string | null | undefined | false>
note string | null
actions Snippet
corner Snippet
children Snippet
class string
Prop Type Default
title required string
badge Snippet
leading Snippet
meta Array<string | null | undefined | false>
note string | null
actions Snippet
corner Snippet
children Snippet
class string

DetailPanel

label string
What this panel is, drawn as the app's one panel label. No label, no actions: no header.
labelIcon PhosphorIcon
labelLead Snippet
A mark the icon set lacks (a platform logo), drawn ahead of the label at the same size.
sublabel string
A line under the label, for the scope a number was measured over.
hint string
A row count, total or freshness stamp. A prop, not an action, because hand-placed hints ended up at three type sizes on one screen.
actions Snippet
Controls that act on this panel. Pinned right, after the hint.
pad boolean
Default true
Off for a body that supplies its own padding: a table, a media grid, a full-bleed list.
scroll boolean
Default false
The body scrolls sideways rather than squeezing, for a table wider than the window.
grow boolean
Default false
Takes the height the panels above it left, inside a `fill` stack. One per stack.
children required Snippet
class string
bodyClass string
Prop Type Default
label

What this panel is, drawn as the app's one panel label. No label, no actions: no header.

string
labelIcon PhosphorIcon
labelLead

A mark the icon set lacks (a platform logo), drawn ahead of the label at the same size.

Snippet
sublabel

A line under the label, for the scope a number was measured over.

string
hint

A row count, total or freshness stamp. A prop, not an action, because hand-placed hints ended up at three type sizes on one screen.

string
actions

Controls that act on this panel. Pinned right, after the hint.

Snippet
pad

Off for a body that supplies its own padding: a table, a media grid, a full-bleed list.

boolean true
scroll

The body scrolls sideways rather than squeezing, for a table wider than the window.

boolean false
grow

Takes the height the panels above it left, inside a `fill` stack. One per stack.

boolean false
children required Snippet
class string
bodyClass string

DetailRow

muted boolean
Default false
children required Snippet
class string
Prop Type Default
muted boolean false
children required Snippet
class string

EmptyState

icon PhosphorIcon
iconWeight "bold" | "duotone" | "fill" | "light" | "thin" | "regular"
iconClass string
Replaces the muted colour of a bare icon. Ignored by the tile, which stays foreground.
title required string
description string
actionLabel string
actionHref string
onAction () => void
actions Snippet
Several ways out, drawn in one row after the single action.
surface "plain" | "card" | "dashed"
Default "plain"
`card` fills the white panel; `dashed` frames a whole dashboard section.
size "default" | "sm"
Default "default"
`sm` fits a 280px rail: a bare icon and one line of small type.
class string
Prop Type Default
icon PhosphorIcon
iconWeight "bold" | "duotone" | "fill" | "light" | "thin" | "regular"
iconClass

Replaces the muted colour of a bare icon. Ignored by the tile, which stays foreground.

string
title required string
description string
actionLabel string
actionHref string
onAction () => void
actions

Several ways out, drawn in one row after the single action.

Snippet
surface

`card` fills the white panel; `dashed` frames a whole dashboard section.

"plain" | "card" | "dashed" "plain"
size

`sm` fits a 280px rail: a bare icon and one line of small type.

"default" | "sm" "default"
class string

PrevNext

ids required readonly string[]
Ids in the order the list shows them.
current required string | null | undefined
onSelect required (id: string) => void
previousLabel string
Default "Previous"
nextLabel string
Default "Next"
keys boolean
Default true
Off when two steppers share a page, so one key press moves one list.
class string
Prop Type Default
ids required

Ids in the order the list shows them.

readonly string[]
current required string | null | undefined
onSelect required (id: string) => void
previousLabel string "Previous"
nextLabel string "Next"
keys

Off when two steppers share a page, so one key press moves one list.

boolean true
class string

NoticeBar

tone Tone
Default "destructive"
icon PhosphorIcon
actions Snippet
children required Snippet
class string
Prop Type Default
tone Tone "destructive"
icon PhosphorIcon
actions Snippet
children required Snippet
class string

GroupedList

groups required TGroup[]
getKey required (group: TGroup) => string
defaultCollapsed string[]
Default []
onCollapsedChange (keys: string[]) => void
WHY: a page that drives its own keyboard cursor has to know which rows are on screen, and the collapsed set is the only thing that says so.
header required Snippet<[TGroup, { collapsed: boolean }]>
actions Snippet<[TGroup]>
Controls beside the header, outside its toggle button so a click on one doesn't collapse the group. Shown on hover of the header row.
rows required Snippet<[TGroup]>
getCount (group: TGroup) => number
A count beside the header, in a small pill. Leave it out when the header draws its own.
onAdd (group: TGroup) => void
Shows an add button at the end of the header row.
addLabel string
Default "Add"
The add button's accessible name.
class string
onGroupDragOver (e: DragEvent, group: TGroup) => void
onGroupDragLeave (e: DragEvent) => void
onGroupDrop (e: DragEvent, group: TGroup) => void
Prop Type Default
groups required TGroup[]
getKey required (group: TGroup) => string
defaultCollapsed string[] []
onCollapsedChange

WHY: a page that drives its own keyboard cursor has to know which rows are on screen, and the collapsed set is the only thing that says so.

(keys: string[]) => void
header required Snippet<[TGroup, { collapsed: boolean }]>
actions

Controls beside the header, outside its toggle button so a click on one doesn't collapse the group. Shown on hover of the header row.

Snippet<[TGroup]>
rows required Snippet<[TGroup]>
getCount

A count beside the header, in a small pill. Leave it out when the header draws its own.

(group: TGroup) => number
onAdd

Shows an add button at the end of the header row.

(group: TGroup) => void
addLabel

The add button's accessible name.

string "Add"
class string
onGroupDragOver (e: DragEvent, group: TGroup) => void
onGroupDragLeave (e: DragEvent) => void
onGroupDrop (e: DragEvent, group: TGroup) => void