How to build an accessible HeaderPanel in React

role="region" with the label prop names the panel as a landmark; Escape closes it and focus is managed so keyboard users can dismiss it without a mouse

When to use a HeaderPanel

When not to use it

Keyboard interactions

Role region, verified at WCAG 2.2-AA.

Common mistakes

Avoid: Using HeaderPanel for a blocking confirmation

Prefer: <Modal> or <AlertDialog> for decisions that must block

HeaderPanel is non-modal and light-dismissable; blocking flows need modal semantics

Example

<HeaderPanel open={open} onClose={() => setOpen(false)} label="Notifications">
  <p>3 unread messages</p>
</HeaderPanel>

See the full HeaderPanel reference →