Popover

A small panel anchored to the control that opened it — pick a day, glance at a booking. The page stays live around it; a press outside or Escape closes it. A white squircle 8px off its trigger, built on the vendored Base UI popover.

Playground

PopoverContent
Parts

Date picker

The day view's picker. A flush popover hugs the Calendar, which brings its own padding; aligned to the trigger's start edge, it closes as soon as a day is picked.

Details

A booking at a glance: a header names it, a line or two says the rest, and small buttons offer what comes next. PopoverClose closes the popover as it acts.

Placement

Below the trigger by default. side picks another edge and align slides it along; near the screen's edge it flips and shifts to stay in view on its own.

API reference

PopoverContent

PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left""bottom"The trigger's edge it opens from. Flips when there's no room.
align"start" | "center" | "end""center"Where it sits along that edge.
sideOffsetnumber8Pixels between trigger and panel.
alignOffsetnumber0Pixels to shift it along the edge.
flushbooleanfalseNo padding, width of its content — for a Calendar or a list that brings its own.
classNamestring—Layout only — a width such as w-80 or w-auto. Never restyle the surface here.

Popover

PropTypeDefaultDescription
openboolean—Controlled open state; pair it with onOpenChange — e.g. to close once a day is picked.
onOpenChange(open: boolean) => void—Called on every open and close — trigger, PopoverClose, Escape, a press outside.
defaultOpenbooleanfalseOpen on first render, uncontrolled.
modalboolean | "trap-focus"falseLock the page behind it. Rarely right — reach for a Dialog instead.

Parts

PropTypeDefaultDescription
PopoverTriggerrender—Opens and closes it. Give it a Button: render={<Button>…</Button>}.
PopoverHeaderdiv—Stacks the title over the description.
PopoverTitleh2—Names the popover for assistive tech.
PopoverDescriptionp—A quiet line under the title.
PopoverCloserender—Closes it from inside. Give it a Button: render={<Button size="sm">Done</Button>}.

Guidelines

  • A popover belongs to its trigger: what's in it is about that control. A task that stands on its own — a form, a decision — is a Dialog.
  • Keep it small: a picker, a few lines, at most two small actions. If it needs to scroll, it wants to be a page or a dialog.
  • The trigger says what opens — the chosen day, the booking's time and service — not “More” or an unlabelled icon.
  • Close it the moment its job is done: a picked day, a chosen action. Don't make people dismiss it by hand.
  • Never open a popover from inside another. For choices from a list, use Select.