Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Popover

Displays rich content in a portal, triggered by a button.

Installation

npx logic2b@latest add popover

Usage

import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"

<Popover>
  <PopoverTrigger>Open</PopoverTrigger>
  <PopoverContent>Place content for the popover here.</PopoverContent>
</Popover>

API

Prop Type Default
align (PopoverContent) start | center | end center
sideOffset (PopoverContent) number 4
side (PopoverContent) top | right | bottom | left bottom

Examples

Form content

Side and alignment

Accessibility

Built on Radix Popover.

  • The trigger toggles the popover on click and manages aria-expanded and aria-controls for you.
  • Focus moves into the popover when it opens and returns to the trigger on close.
  • Esc or an outside click dismisses the popover.
  • Use PopoverAnchor to position the content relative to a different element than the trigger.