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
- Tile (
.kit-blk-dh): grid, min-height 110px, 20px padding, radius--r-lg, tinted bytone(.kit-blk-tone--*). - Lead (
.kit-blk-dh-lead, optional): a 56–64pxProductThumb,AvatarorAvatarStack. - Title (
.kit-blk-dh-title): display face, 20px, 700, wraps anywhere. - Sub (
.kit-blk-dh-sub, optional): 13px, flex with gap 6 (text, pills, a SKU).
Variants
| Prop | Value | Look | Use when |
|---|---|---|---|
tone | 'lime' | --lime-50 fill, olive ink | Creators, money in. |
tone | 'rasp' | --rasp-50 fill, wine ink | Challenges. |
tone | 'butter' | --butter fill | Orders, commissions (order #48211). |
tone | 'sky' | --sky fill | Gifts, payouts. |
tone | 'lilac' | --lilac fill | Bonuses. |
lead | set | Two columns: lead, then words (kit-blk-dh--lead) | Product, person or group drawers. |
lead | omitted | One 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
- Brand › Analytics › product drawer (
openProduct()). Screen: Commissions and product details. - Brand › Payments › Commissions › order drawer (
openOrder()), Payouts › payout drawer. Screens: Commissions and product details, Payments · Payouts. - Brand › Motivation › gift drawer (
openGift()), gift order drawer (openGiftOrder()). Screens: Motivation · Gifts, Motivation · Bonuses.
Guidelines
Do
- Make it the first child of the drawer body (
.kit-blk-panelgives it an 18px gap below). - Repeat the title in the
Drawer'stitlewithhideTitle, 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
CalloutCardorHeroCardon 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 theDrawertitle; 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-hiddenin 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.
Related
Drawer: the container.KeyValue,RowItems,StepTimeline: what usually follows it.BrandDetailHeader(PR): a page-level header, not a drawer head.
See also: ProductThumb · CalloutCard · CheckList · CopyLinkField · ProgressRow
Source
src/blocks/shared/DrawerHead.tsx (line 13) on GitHub.