Skip to content
ComponentsMarkdown

Popover

Non-modal floating panel anchored to a trigger, built on Radix Popover. Uses the shared popupSurface style with no arrow.

Live example

Props

PropTypeDefaultDescription
Popover.open / defaultOpenboolean—Controlled or uncontrolled open state on the Popover root.
PopoverContent.sideOffsetnumber8Distance in pixels between trigger and popover panel.
PopoverContent.align"start" | "center" | "end""center"Alignment of the popover relative to its trigger.
PopoverContent.containerHTMLElement | nullmodal or bodyOptional portal container override; defaults to nearest Dialog/Sheet portal container.

Sizes and tokens

Tier / RoleTokenValue
Width & paddingw-[min(18rem,calc(100vw-2rem))] / --space-4288px width · 16px padding · 8px sideOffset · no arrow
Surface--popover / --popover-foreground / --shadow-md / --z-dropdownStep 3 surface · 1px border · radius-md (8px) · z-index 20
Motion--duration-162 / --duration-100Fade + scale 0.96→1 (162ms enter, 100ms exit); opacity-only when reduced

States

Code

import {
  Button,
  Popover,
  PopoverClose,
  PopoverContent,
  PopoverTrigger,
} from "@freshgemui/monoplinth";

export function Example() {
  return (
    <Popover>
      <PopoverTrigger asChild>
        <Button variant="outline">Details</Button>
      </PopoverTrigger>
      <PopoverContent>
        <p>Token values update immediately on mode change.</p>
        <PopoverClose asChild>
          <Button size="sm" variant="secondary">
            Done
          </Button>
        </PopoverClose>
      </PopoverContent>
    </Popover>
  );
}

Do and don't

Do: Use Popover for interactive secondary controls
Place compact forms, filters, or rich details inside PopoverContent where keyboard users can tab through controls.
Don't: Use Popover for plain single-line hints
Use Tooltip for short non-interactive text labels on hover and focus.

Accessibility

  • Focus moves into PopoverContent on open and returns to PopoverTrigger when closed via Escape, outside click, or PopoverClose.
  • Inside Dialog or Sheet, PopoverContent automatically portals into the modal's container so it remains interactive above z-modal.

Rationale

Sharing popupSurface with Select and Tooltip keeps all floating surfaces visually consistent while sideOffset={8} maintains clear breathing room from the trigger.