Panel Header

The header of a layered panel, drawer, sheet or dialog: a 40 px icon tile, a 16 px title with a muted line under it, a round close button, 16 / 24 padding and a rule underneath.

BetaReady to use. Its API can still change in a minor release; the changelog says when.

import { PanelHeader } from "@leap-crm/design-system";

Playground

Change a prop and the component follows. Its code is under Props.

Jane Citizen

Individual · Client

Props

title
subtitle
icon
tone
onClose

Best practices

When to use it, and the rules that apply in particular places.

GuidancePractice
DoUse it at the top of a layered panel or sheet you build yourself, and pass onClose so there is a visible way out besides Escape.
DoPass titleId and point the panel's aria-labelledby at it, so a screen reader names the panel by its title.
DoSet closeLabel when panels stack, like "Close contact" over an opportunity, so each close button has a unique name.
Don'tUse it in a Drawer or Dialog. Use DrawerHeader or DialogHeader, which wire the title and close button to the popup itself.
Don'tUse it to head a section inside the panel. Use SectionHeader, a step down in size, so the panel's own title stays the strongest.

Props

PropTypeDefaultDescription
iconReactNode—The 20 px icon in the 40 px tile on the left.
toneExclude<Tone, "default" | "plum"> | "neutral""info"The icon tile's colour, as IconTile.
title *ReactNode—The panel's name.
subtitleReactNode—One muted line straight under the title.
onClose() => void—Shows the round close button and runs when it's pressed.
closeLabelstring"Close"Names the close button when "Close" isn't enough.
titleIdstring—An id for the title, so a dialog or drawer can name itself with aria-labelledby.
classNamestring—Classes added to the root element, merged with its own. Tokens only.

Code

What the playground shows, ready to copy.

import { PanelHeader, PlusIcon } from "@leap-crm/design-system";

<PanelHeader
  title="Jane Citizen"
  subtitle="Individual · Client"
  icon={<PlusIcon />}
/>

Keyboard

The keys it answers to. Tab moves between components, arrows move within them.

KeysWhat they do
EnterSpaceClose the panel, with focus on its close button.