Group Header

View as Markdown

The line over a group of rows with its count, sticky while they scroll, folding the group.

  • Send the Q4 renewal quote to Northwind28 Nov
  • Review the security questionnaire1 Dec
  • Call back Harborview Supply about seats2 Dec

  • Prep the pricing review deck4 Dec
  • Reply to Priya on the SSO question4 Dec
  • Update the Billing migration status4 Dec
  • Book the offsite venue4 Dec

  • Interview: senior designer5 Dec
  • 1:1 with Tomás6 Dec
  • Close out November expenses7 Dec

When to use

The line over a group of rows with its count, sticky while they scroll, folding the group. Use Accordion instead when the sections are content, not groups of rows.

Usage

import { GroupHeader } from "./ui/uicontext/components/GroupHeader.ts"
const Message = UiSchema.TaggedEnum({ ToggledDone: {} })export const DoneHeader = (h: Html.H<typeof Message.Type>, open: boolean) =>	GroupHeader(h, { title: "Done", count: 12, sticky: true, open, onToggle: Message.ToggledDone(), controls: "done-rows" })

Examples

Plain headings

Without onToggle it's a heading and a count; level places it among the page's headings.

Needs your review2

  • Dark mode for settings
  • Retry failed webhooks

Waiting on others3

  • Rate-limit the export API
  • New invoice template
  • Search by customer email

API reference

Options

GroupHeader options
NameTypeDefaultDescription
titlerequiredstring——
countnumber—How many rows the group holds, shown after the title.
tone"danger" | "accent"—Colors the title: danger for overdue, accent for what needs you.
stickyboolean—Sticks to the top of its scrolling list while its rows pass under it.
level2 | 3 | 43The heading level, so the groups show in a screen reader's list of headings. 3 by default.
openboolean—Whether the group is open; with onToggle, the header folds it.
onToggleMessage——
controlsstring—The id of the element holding the group's rows, which the toggle opens and closes.
endView.Content—Things at the end: an "Add" button, a menu.
localestring——
styleStyle——

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/group-header

Source