datui
Color scheme

Navigation

PanelHeaderContext

Drop-down sheet that slides out under the PanelHeader, e.g. to switch modes or filters.

import { PanelHeaderContext } from "datui";

Examples

Mode switcher

Place it right after the PanelHeader. Point the trigger's aria-controls at the sheet's id.

Showing: All news

Accessibility

  • Renders role="dialog" named by label (default "Options"). Focus moves into the sheet when it opens and back to the previously focused element when it closes.
  • Escape and a press outside the sheet call onClose; pressing the trigger (matched by aria-controls) is not treated as outside, so it can toggle.
  • Set aria-expanded on the trigger yourself — PanelHeaderContent passes it through.
  • Body scroll is locked on compact widths while open. Opening and closing animate unless reduced motion is on.

API

PanelHeaderContext

Drop-down sheet under the `PanelHeader`. Place it right after the header. Give the trigger `aria-controls={id}` so pressing it toggles instead of counting as an outside press.

PropTypeDefaultDescription
onClose (required)() => void—Called on Escape and on a press outside the sheet and its trigger.
opened (required)boolean—
classNamestring—
labelstringOptionsAccessible name of the sheet.