Skip to content

Popover

A small floating container triggered by click. Displays rich content like text, forms, or option lists anchored to a trigger element.

Preview

Project settings
Configure visibility, notifications, and team access for this project.
What is this?
Popovers display contextual information or actions anchored to a trigger element.

Positions

PositionDescription
topAbove the trigger
rightTo the right of the trigger
bottomBelow the trigger
leftTo the left of the trigger

Props

PropTypeDefaultDescription
openbooleanfalseControlled open state
onOpenChange(open: boolean) => void--Open state change handler
position'top' | 'right' | 'bottom' | 'left''bottom'Preferred placement
trigger'click' | 'hover''click'How to open the popover
closeOnOutsideClickbooleantrueClose when clicking outside
classNamestring--Additional CSS classes
childrenReact.ReactNode--Popover content

Code example

React

tsx
import { Popover, PopoverTrigger, Button } from '@thepace/lexicon/components';

<PopoverTrigger>
  <Button variant="secondary" size="sm">Settings</Button>
  <Popover position="bottom">
    <h4>Project settings</h4>
    <p>Configure visibility and access.</p>
  </Popover>
</PopoverTrigger>

Vanilla HTML

html
<div class="lex-popover-wrapper">
  <button class="lex-button lex-button--secondary lex-button--sm">Settings</button>
  <div class="lex-popover lex-popover--bottom" role="dialog">
    <div class="lex-popover__title">Project settings</div>
    <div class="lex-popover__body">Configure visibility and access.</div>
  </div>
</div>

CSS class reference

ClassPurpose
.lex-popover-wrapperPositioning container
.lex-popoverPopover panel
.lex-popover--topTop position
.lex-popover--rightRight position
.lex-popover--bottomBottom position
.lex-popover--leftLeft position
.lex-popover__titleTitle text
.lex-popover__bodyBody content

Accessibility

  • Uses role="dialog" when interactive, or no role for informational content.
  • Focus moves into the popover when opened via click.
  • Escape closes the popover and returns focus to the trigger.
  • Outside clicks close the popover.

Guidelines

Do

  • Use for contextual info, small forms, or settings.
  • Keep popover content brief — under 200 words.
  • Use the appropriate position to avoid viewport overflow.

Don't

  • Don't use a popover for complex or multi-step forms — use a modal or drawer.
  • Don't use for simple text hints — use a Tooltip instead.
  • Don't use hover trigger for interactive content (links, buttons inside).

Released under the MIT License. A product by the pace.