Skip to Content
BBRICKSv0.7.4
KitOverlays

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

  1. Drawer: scrim, panel, close ×, focus trap (see Drawer).
  2. Hero (.kit-dd-hero.kit-dd-tone--{tone}, optional): avatar, bold name (dir="auto"), subtitle, chips, badge.
  3. Tiles (.kit-dd-tiles): value over label, each in a tone.
  4. Sections (section.kit-dd-sec): h3 title, KeyValue rows (columns, default 2), DetailsBars, ranked ol (rank number, lead, title + subtitle, value), content.
  5. Footer (.kit-dd-foot): actions row, full-width primary, grey note.

Variants

PropValueLookWhen
herosetToned hero tile with the nameA person
heroomittedPlain 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—
footeractionsRow of small buttonsSeveral actions
footerprimary + noteOne full-width button and a grey lineOne main action ("Invite")

States

StateTriggerLook
Closedopen={false}Nothing
OpenopenDrawer with the layout
Minimalonly sectionsHeader + one KeyValue block
Ranked row without valuevalue omittedNo 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

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; with hero the title stays the dialog name (hidden).
  • The ranked list's rank number is hidden; give title the 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.

See also: Button · Avatar · Pill · DialogSkeleton · Modal

Source

src/kit/patterns/DetailsDrawer.tsx (line 82) on GitHub.

On this page