Skip to Content
BBRICKSv0.7.4
BlocksShared

DrawerHead

The mock's dhead(): the tinted tile at the top of a drawer (min 110px), an optional lead (avatar, product thumb, avatar stack), the title (Jakarta 20) and a sub line. The kit Drawer still owns the dialog's name: give it the same title inside <span className="kit-sr"> so it is not drawn twice. Title and sub are isolated in their own script's direction (B15). With a lead the head carries kit-blk-dh--lead; without one, kit-blk-dh--nolead (one column, so a long title wraps in browsers without :has()).

import { DrawerHead } from '@ergasti/bricks';

Examples

Tinted drawer head

The coloured top of a block drawer: a lead (picture or avatar), a title and a sub line.

Code
import { DrawerHead, ProductThumb } from '@ergasti/bricks';
import { blocksData } from './sample-data';

function Head() {
  return (
    <div style={{ maxWidth: 400, display: 'grid', gap: 12 }}>
      <DrawerHead tone="sky" title="Eyeshadow palette" sub="Gift · 16 left" lead={<ProductThumb name="Eyeshadow palette" src={blocksData.photo(2)} size={56} />} />
      <DrawerHead tone="lime" title="Winter glow launch" sub="Live · day 13 of 30" />
    </div>
  );
}

Props

Prop

Type

Design guidance

How the BRICKS design system uses DrawerHead. Written in docs/content/components/DrawerHead.md; the props above are read from the code, which wins where the two disagree.

The tinted tile at the top of a drawer: an optional lead (thumb, avatar, avatar stack), the title in the display face and a sub line; use it as the first child of every detail drawer's body.

It is the mock's dhead(), used by the product, order, gift, gift order and payout drawers. The kit Drawer still owns the dialog's accessible name: open the drawer with the same title and hideTitle (or a kit-sr title) so it is not drawn twice. Title and sub are isolated in their own script's direction.

Anatomy

  1. Tile (.kit-blk-dh): grid, min-height 110px, 20px padding, radius --r-lg, tinted by tone (.kit-blk-tone--*).
  2. Lead (.kit-blk-dh-lead, optional): a 56–64px ProductThumb, Avatar or AvatarStack.
  3. Title (.kit-blk-dh-title): display face, 20px, 700, wraps anywhere.
  4. Sub (.kit-blk-dh-sub, optional): 13px, flex with gap 6 (text, pills, a SKU).

Variants

PropValueLookUse when
tone'lime'--lime-50 fill, olive inkCreators, money in.
tone'rasp'--rasp-50 fill, wine inkChallenges.
tone'butter'--butter fillOrders, commissions (order #48211).
tone'sky'--sky fillGifts, payouts.
tone'lilac'--lilac fillBonuses.
leadsetTwo columns: lead, then words (kit-blk-dh--lead)Product, person or group drawers.
leadomittedOne column (kit-blk-dh--nolead)Orders and payouts (story NoLead).

Analytics cycles the tone per product (DRAWER_TONES[id % 5]).

States

Static. A long title wraps (overflow-wrap: anywhere) and the tile grows; mixed Arabic/Latin titles keep their own direction.

Types

BlockTone (tone): 'lime' | 'rasp' | 'butter' | 'sky' | 'lilac'.

Usage

// Analytics › product drawer
<Drawer open onClose={close} title={p.name} hideTitle>
  <div className="kit-blk-panel">
    <DrawerHead tone="sky" title="Eyeshadow palette" sub="EP-012"
      lead={<ProductThumb name="Eyeshadow palette" size={64} seed={0} />} />
    <KeyValue items={[
      { label: 'Units sold', value: '412' },
      { label: 'Sales', value: <Money value="98880.00" compact /> },
    ]} />
    <RowItems heading="Top creators for it" label="Top creators for it" items={topCreators} />
  </div>
</Drawer>
// Payments › Commissions › order drawer: no lead
<DrawerHead tone="butter" title="Order #48211" sub="11 Nov 2026" />

Where it appears

Guidelines

Do

  • Make it the first child of the drawer body (.kit-blk-panel gives it an 18px gap below).
  • Repeat the title in the Drawer's title with hideTitle, so the dialog is named.
  • Keep the sub to one line of facts.

Don't

  • Don't put buttons in it; actions go in the drawer footer.
  • Don't use it outside a drawer; use CalloutCard or HeroCard on pages.

RTL and Arabic

  • The lead moves to the right; text aligns right; letter-spacing resets to 0 for Arabic.
  • SKUs and order numbers stay LTR inside the isolated sub.

Tokens

.kit-blk-tone--* (--lime-50, --olive, --rasp-50, --butter, --butter-ink, --sky, --sky-ink, --lilac, --lilac-ink), --r-lg, --font-family-display, --tracking-display.

Accessibility

  • The title is a <p>: the dialog's name comes from the Drawer title; do not add a second heading with the same words.
  • Title and sub are wrapped in Isolate, so mixed-direction text reads correctly.
  • The lead should be decorative (thumbs and avatars are aria-hidden in the kit).

Found in the source

  • No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

See also: ProductThumb · CalloutCard · CheckList · CopyLinkField · ProgressRow

Source

src/blocks/shared/DrawerHead.tsx (line 13) on GitHub.

On this page