Popover

A popover displays content in a floating container that appears above other content.

<Dialog>
  <Button aria-label="Help">
    <InfoIcon />
  </Button>
  <Popover>
    <DialogContent className="w-56 space-y-4">
      <DialogHeading>Need help?</DialogHeading>
      <p>If you&apos;re having issues accessing your account, contact our customer support team for help.</p>
    </DialogContent>
  </Popover>
</Dialog>

Installation

npx shadcn@latest add @dotui/popover

Usage

Use popovers to display rich content in a floating container that appears above other content.

import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogHeading } from "@/components/ui/dialog";
import { Popover } from "@/components/ui/popover";
<Dialog>
  <Button>Open Popover</Button>
  <Popover>
    <DialogContent>
      <DialogHeading>Popover Title</DialogHeading>
      <p>Popover content</p>
    </DialogContent>
  </Popover>
</Dialog>

Playground

Use the controls below to experiment with different popover props and see the live preview and code update.

placement
<Dialog>
  <Button>Open Popover</Button>
  <Popover placement="bottom">
    <DialogContent className="w-56">
      <DialogHeading>Popover Title</DialogHeading>
      <p className="text-fg-muted text-sm">
        This is a popover with some content. You can put any content here.
      </p>
    </DialogContent>
  </Popover>
</Dialog>

API Reference

A popover is an overlay element positioned relative to a trigger.

PropType
boolean
string
RefObject<Element | null>
boolean
boolean
Element
Placement
Element
RefObject<Element | null>
RefObject<Element | null>
boolean
number
number
boolean
boolean
((element: Element) => boolean)
ReactNode | function

Last updated on 1/13/2026

Built with passion by @mehdibha.