@objectifthunes/whiteboard
OVERLAYS

Drawer

A panel sliding in from a screen edge. The row-detail view beside a table; becomes a bottom sheet on phones.


PREVIEW
SOURCE
import { Drawer, Button, ButtonRow, DescriptionList } from '@objectifthunes/whiteboard'

<Drawer
  open={Boolean(selected)}
  onClose={() => setSelected(null)}
  side="right"
  title={selected?.number}
  description="Acme Industries · issued 12 August 2026"
  footer={
    <ButtonRow>
      <Button variant="secondary" onClick={close}>Close</Button>
      <Button onClick={markPaid}>Mark as paid</Button>
    </ButtonRow>
  }
>
  <DescriptionList items={details} />
</Drawer>
NOTES

The SaaS use for this is the detail view: click a table row, inspect and edit it beside the list instead of navigating away and losing your filters and scroll position. Pair it with DataTable's onRowClick and activeKey.

Sides are right (default), left and bottom. Sizes are sm (20rem), md (26rem) and lg (38rem).

Under 640px every side drawer becomes a bottom sheet. 26rem of side panel on a phone is a wall, so the CSS retargets it rather than letting you ship something unusable.

Same focus trap, scroll lock and Escape handling as Modal — they share theuseFocusTrap, useBodyScrollLock and useEscapeKey hooks, which are exported if you build your own overlay.