DetailsDrawer
The shared row-details sheet (kit Drawer + KeyValue): a plain header or a tinted hero, stat tiles, sections of key/value rows, bars, ranked lists or any node, then actions. Built from a row's own data; no fetch.
Deprecated
Since 0.5.0: compose the v3 drawer body instead, Drawer + DrawerHead + KeyValue + RowItems (+ StepTimeline, RankList), as the blocks' panels do (MyCreatorPanel, PayoutBatchDetail): soft 14px tiles and 14/700 section headings, where this sheet draws bordered tiles and 800 headings. It keeps working until 1.0.
import { DetailsDrawer } from '@ergasti/bricks';Examples
Row details
A ready-made drawer for "open this row": a hero, stat tiles and sections made of rows, bars or a ranked list. Deprecated since 0.5.0 for new screens: compose Drawer + DrawerHead + KeyValue + RowItems (with StepTimeline or RankList) instead, as the blocks' panels do (the Drawer page shows one), and DetailsBars for its bar list. It keeps working until 1.0.
Code
import { useState } from 'react';
import { Avatar, Button, DetailsDrawer, Pill } from '@ergasti/bricks';
function Creator() {
const [open, setOpen] = useState(false);
return (
<>
<Button variant="ink" onClick={() => setOpen(true)}>Open details</Button>
<DetailsDrawer
open={open}
onClose={() => setOpen(false)}
title="Laila Saeed"
hero={{ tone: 'lime', avatar: <Avatar name="Laila Saeed" seed={1} size="lg" />, title: 'Laila Saeed', subtitle: '@laila.saeed', chips: <Pill tone="ok">Elite</Pill>, badge: 'Top 10% seller' }}
tiles={[{ value: 'EGP 212K', label: 'Sold', tone: 'lime' }, { value: '785', label: 'Orders', tone: 'sky' }, { value: '3.1%', label: 'Engagement', tone: 'butter' }, { value: '8', label: 'Brands', tone: 'lilac' }]}
sections={[
{ title: 'Highlights', rows: [{ label: 'Joined', value: '6 Oct 2026' }, { label: 'Tier', value: 'Elite' }] },
{ title: 'Followers', bars: [{ label: 'Instagram', value: '143K', percent: 30 }, { label: 'TikTok', value: '310K', percent: 70 }] },
{ title: 'Top creators', ranked: [{ rank: 1, lead: <Avatar name="Karim Adel" seed={2} size="sm" />, title: 'Karim Adel', subtitle: '@karim', value: 'EGP 98K' }] },
]}
primary={<Button variant="ink">Invite</Button>}
note="Each invite holds a seat until the creator replies."
/>
</>
);
}Plain header and a row of actions
Without hero the header is the title with lead before it and subtitle under it; actions is a footer row of small buttons.
Code
import { useState } from 'react';
import { Avatar, Button, DetailsDrawer } from '@ergasti/bricks';
function PlainHeader() {
const [open, setOpen] = useState(false);
return (
<>
<Button onClick={() => setOpen(true)}>Open order</Button>
<DetailsDrawer
open={open} onClose={() => setOpen(false)} title="Order #10482" subtitle="12 Nov · 21:04" lead={<Avatar name="Omar Khaled" seed={5} size="lg" />}
sections={[{ title: 'Order', rows: [{ label: 'Commission', value: 'EGP 620.00' }, { label: 'Coupon', value: 'OMAR10' }] }]}
actions={<><Button size="sm">Open in admin</Button><Button size="sm" variant="rasp">Hold commission</Button></>}
/>
</>
);
}Props
Prop
Type
Design guidance
How the BRICKS design system uses DetailsDrawer. Written in docs/content/components/DetailsDrawer.md; the props above are read from the code, which wins where the two disagree.
A ready-made "open this row" drawer built from data: a tinted hero or plain header, 2×2 stat tiles, sections of key/value rows, bars or a ranked list, then actions; deprecated since 0.5.0 in favour of composing Drawer + DrawerHead + KeyValue + RowItems.
DetailsDrawer wraps Drawer and lays out a record from the row's own data (no fetch). With hero the name moves into a toned tile with avatar, chips and a badge (the dialog keeps title as its accessible name); without it the header is the title with lead and subtitle. Sections draw, in order, a KeyValue grid, DetailsBars, a ranked list and any node. The v3 drawers use soft 14px tiles and 14/700 section headings, where this sheet draws bordered tiles and 800 headings, so new screens compose the body instead, as the blocks' panels do (MyCreatorPanel, PayoutBatchDetail). It keeps working until 1.0.
Anatomy
- Drawer: scrim, panel, close ×, focus trap (see
Drawer). - Hero (
.kit-dd-hero.kit-dd-tone--{tone}, optional): avatar, bold name (dir="auto"), subtitle, chips, badge. - Tiles (
.kit-dd-tiles): value over label, each in a tone. - Sections (
section.kit-dd-sec):h3title,KeyValuerows (columns, default 2),DetailsBars, rankedol(rank number, lead, title + subtitle, value),content. - Footer (
.kit-dd-foot):actionsrow, full-widthprimary, greynote.
Variants
| Prop | Value | Look | When |
|---|---|---|---|
hero | set | Toned hero tile with the name | A person |
hero | omitted | Plain drawer header (title, lead, subtitle) | An order, a payout |
hero.tone / tile tone | 'lime' (hero default) 'rasp' 'butter' 'sky' 'lilac' 'plain' (tile default) | Tinted surfaces | — |
| footer | actions | Row of small buttons | Several actions |
| footer | primary + note | One full-width button and a grey line | One main action ("Invite") |
States
| State | Trigger | Look |
|---|---|---|
| Closed | open={false} | Nothing |
| Open | open | Drawer with the layout |
| Minimal | only sections | Header + one KeyValue block |
| Ranked row without value | value omitted | No empty cell drawn |
Types
DetailsHero (hero): { tone?, avatar?, title, subtitle?, chips?, badge? }. DetailsSection (sections): { title?, rows?, columns?: 1 | 2 | 3, bars?, ranked?, content? }.
Usage
<DetailsDrawer open={open} onClose={() => setOpen(false)} title="Laila Saeed"
hero={{ tone: 'lime', avatar: <Avatar name="Laila Saeed" seed={1} size="lg" />, title: 'Laila Saeed', subtitle: '@laila.saeed', chips: <Pill tone="ok">Elite</Pill>, badge: 'Top 10% seller' }}
tiles={[{ value: 'EGP 212K', label: 'Sold', tone: 'lime' }, { value: '785', label: 'Orders', tone: 'sky' }, { value: '3.1%', label: 'Engagement', tone: 'butter' }, { value: '8', label: 'Brands', tone: 'lilac' }]}
sections={[
{ title: 'Highlights', rows: [{ label: 'Joined', value: '6 Oct 2026' }, { label: 'Tier', value: 'Elite' }] },
{ title: 'Followers', bars: [{ label: 'Instagram', value: '143K', percent: 30 }, { label: 'TikTok', value: '310K', percent: 70 }] },
]}
primary={<Button variant="ink">Invite</Button>} note="Each invite holds a seat until the creator replies." />Plain header and actions:
<DetailsDrawer open={open} onClose={close} title="Order #10482" subtitle="12 Nov · 21:04" lead={<Avatar name="Omar Khaled" seed={5} size="lg" />}
sections={[{ title: 'Order', rows: [{ label: 'Commission', value: 'EGP 620.00' }, { label: 'Coupon', value: 'OMAR10' }] }]}
actions={<><Button size="sm">Open in admin</Button><Button size="sm" variant="rasp">Hold commission</Button></>} />The v3 replacement:
<Drawer open={open} onClose={close} title="Laila Saeed" hideTitle>
<DrawerHead tone="lime" title="Laila Saeed" sub="@laila.saeed" lead={<Avatar name="Laila Saeed" seed={1} size="lg" />} />
<KeyValue items={[{ label: 'Joined', value: '6 Oct 2026' }, { label: 'Tier', value: <TierChip tier="elite" /> }]} />
</Drawer>Where it appears
- Not used by the v3 screens; PR Portal's creator drawer was built on
Drawer(PrCreatorDrawer). - Kit gallery only.
Guidelines
Do
- Compose
Drawer+DrawerHead+KeyValue+RowItemson new screens. - Keep tiles to four.
Don't
- Don't fetch inside; pass the row's data.
RTL and Arabic
- Mirrors with the drawer (slides from the left in Arabic); names use
dir="auto".
Tokens
Drawer tokens plus the tone tints (--lime-50, --rasp-50, --butter, --sky, --lilac), --line, --ink-3.
Accessibility
- As
Drawer: modal dialog, focus trap, Escape; withherothe title stays the dialog name (hidden). - The ranked list's rank number is hidden; give
titlethe name.
Found in the source
- ARIA attributes set:
aria-hidden. - Its tests cover: “renders nothing without options, and maps an unknown value key to the first option”.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
Drawer,DrawerHead,KeyValue,RowItems: the v3 composition.DetailsBars: its bar list, not deprecated.
See also: Button · Avatar · Pill · DialogSkeleton · Modal
Source
src/kit/patterns/DetailsDrawer.tsx (line 82) on GitHub.