Popover

Popover is a floating panel that appears when clicking a trigger element — ideal for forms, settings panels, and rich interactive overlays.

2
Variants
3
Sizes
4
Sides
Radix
Base

Playground

Preview
defaultBottom
Variant
Size
Side
Options
<Popover>
  <Popover.Trigger asChild>
    <Button variant="outline">Open Popover</Button>
  </Popover.Trigger>
  <Popover.Content>
    <div className="space-y-2">
      <h4 className="font-semibold text-foreground">Settings</h4>
      <p className="text-sm text-text-muted">
        Configure your preferences here.
      </p>
    </div>
  </Popover.Content>
</Popover>

Variants

Default
Paper background with border and shadow — for general-purpose popovers
Forms, settings
Elevated
Glassmorphism background with backdrop blur — for refined floating panels
Profiles, details

Sizes

sm
Font13px
Padding12px
Radius8px
default
Font13px
Padding16px
Radius12px
lg
Font14px
Padding20px
Radius12px

Features

Side Placement

Supports 4 sides (top, right, bottom, left). Default isbottom.

<Popover.Content side="top">Top</Popover.Content>
<Popover.Content side="right">Right</Popover.Content>
<Popover.Content side="bottom">Bottom</Popover.Content>
<Popover.Content side="left">Left</Popover.Content>

Arrow

showArrowcontrols arrow visibility toward the trigger. Shown by default.

{/* With arrow (default) */}
<Popover.Content>With arrow</Popover.Content>

{/* Without arrow */}
<Popover.Content showArrow={false}>No arrow</Popover.Content>

Close Button

showCloseshows a built-in close button.closeIconcustomizes the close icon.

<Popover.Content showClose>
  <h4 className="font-semibold pr-6">Settings</h4>
  <p>Content with close button</p>
</Popover.Content>

Alignment

alignadjusts alignment relative to the trigger.

<Popover.Content align="start">Start</Popover.Content>
<Popover.Content align="center">Center</Popover.Content>
<Popover.Content align="end">End</Popover.Content>

API

Component Structure

Popover— Radix Popover
.Trigger.ContentProps.Arrow.Close.Anchor.Portal

Props

Popover (Root)

openundefined
boolean

Controlled open state

defaultOpenfalse
boolean

Initial open state (uncontrolled)

onOpenChangeundefined
(open: boolean) => void

Callback when open state changes

modalfalse
boolean

Block background interaction and apply focus trap

Popover.Content

variant"default"
"default" | "elevated"

Visual style (default: paper background with border and shadow, elevated: glassmorphism)

size"default"
"sm" | "default" | "lg"

Text size and padding

side"bottom"
"top" | "right" | "bottom" | "left"

Placement side

sideOffsetauto (12 with arrow, 6 without)
number

Distance from trigger (auto: 12px with arrow, 6px without)

align"center"
"start" | "center" | "end"

Alignment relative to trigger

showArrowtrue
boolean

Show arrow indicator

showClosefalse
boolean

Show built-in close button

closeIconundefined
ReactNode

Custom icon for the close button

Anatomy

1
Open popover
sideOffset: 12px
3
2
4
1
Trigger
Launch button
2
Content
Floating panel
3
Arrow
Direction arrow
4
Close
Close button

Best Practices

Do

  • Use Popover for inline editing and form input
  • Suitable for interactive content like links and buttons
  • Use as a lightweight alternative to confirmation dialogs
  • Provide a clear dismiss action via close button or Popover.Close

Don't

  • Don't use Popover for simple hints — use Tooltip instead
  • Don't put large amounts of content in Popover — use Modal instead
  • Don't use Popover for menu lists — use Dropdown instead
  • Don't nest Popovers — it creates complex UX

Popover vs Tooltip

Similar floating UIs — different purposes and interactions.

Trigger

Popover: Click

Tooltip: Hover / Focus

Content

Popover: Rich (forms, buttons, links)

Tooltip: Text only (short hint)

Interaction

Popover: Yes (interactive)

Tooltip: None (read only)

Default side

Popover: bottom (natural top-to-bottom flow)

Tooltip: top (non-intrusive)

Dismiss

Popover: Outside click / Esc / Close button

Tooltip: Auto on hover end

ARIA

Popover: aria-expanded + aria-controls

Tooltip: role="tooltip"

Key difference: Use Popover for interactive content opened by click. Use Tooltip for simple hover hints.

Accessibility

Keyboard

Enter / SpaceOpen / close the popover
EscClose the popover
TabMove focus within content

ARIA / WCAG

  • aria-expanded Auto-applied to trigger
  • aria-controls Auto-linked
  • Automatic focus management (open/close)
  • Automatic collision avoidance