Brand Guide

Components

Popover

A small panel that opens beside its trigger, for detail or a quick task that does not need a dialog.

Default

With a form

Placement

side and align place the popover against its trigger. It opens below, centred, unless told otherwise.

Anchored to another element

PopoverAnchor names the element the popover opens against, in place of its trigger. Here the button opens it, and it lines up with the card.

Staff Software Engineer

QuantumLeap · Up to £136,000

Controlled

Bottom sheet on a phone

The responsive popover is a popover from 640px up and a bottom sheet below that. Narrow the window to see the sheet.

Bottom sheet

The sheet by itself, at any width, so it can be seen here. In the app it is reached through the responsive popover. Drag it down or press outside it to close it.

Best practices

  • A popover holds a little content or a small task beside the thing it is about, and leaves the page behind it usable. For something that must be answered first, use a dialog.
  • For anything with a long list, a calendar or a field, use the parts in responsive-popover.tsx, not Popover. Below 640px they open a bottom sheet, which leaves room for the keyboard. The combobox, phone input and date field already do.
  • A bottom sheet shows no heading, so title is required: it is the name a screen reader announces.
  • The sheet itself never scrolls. Content taller than the sheet brings its own scrolling area.
  • Near the edge of the screen a popover flips to the opposite side, or slides along its trigger and keeps the alignment it was given.
  • To lift a popover above another layer, pass a z-index as positionerClassName, not in className. The positioner is what stacks.