1. Documentation
  2. Overlays
  3. Popover
ReadmenpmGitHub
  • Introduction
  • Installation
  • Theming
  • Icons
  • Accordion
  • Card
  • Scroll Area
  • Separator
  • Sidebar
  • Field
  • Label
  • Input
  • Textarea
  • Number Field
  • OTP Field
  • Select
  • Combobox
  • Checkbox
  • Radio
  • Switch
  • Slider
  • Toggle
  • Calendar
  • Date Picker
  • File Upload
  • Button
  • Copy Button
  • Dropdown
  • Command
  • Tabs
  • Breadcrumb
  • Pagination
  • Tree
  • Table
  • Data Table
  • Stat
  • Timeline
  • Avatar
  • Status Bar
  • Badge
  • Meter
  • Empty
  • Skeleton
  • Spinner
  • Toast
  • Dialog
  • Sheet
  • Popover
  • Tooltip
  • Text
  • Kbd
  • Code Block
  • Utilities
  • Design rules

Popover

Rich content anchored to a trigger — with its own layout, unlike a tooltip or a menu.

Loading documentation…

Sheet< PreviousTooltipNext >

Powered by heyo

On this page

UsageHeader and closePlacementPropertiesPopoverPopover.ContentThe rest
<Popover><Popover.Trigger render={<Button icon={IconFilter}>Filters</Button>} /><Popover.Content title="Filters" description="Applied to the current view.">  <div className="flex flex-col gap-2">    <Checkbox defaultChecked label="Errors only" />    <Checkbox label="Include previews" />  </div></Popover.Content></Popover>

Three components float above the page, and they do different jobs:

  • Tooltip for a label — a few words, no interaction.
  • Dropdown for a list of actions.
  • Popover for anything with its own layout: filters, a form, a preview, a short explanation with a link in it.

Usage

tsx
import { Button, Popover } from "@heyo-sh/heyo-ui";<Popover>  <Popover.Trigger render={<Button>Filters</Button>} />  <Popover.Content title="Filters">…</Popover.Content></Popover>;

Header and close

Passing title (and optionally description) renders the heading block and a close button for you. Without them the popup is a bare surface and you own every pixel of it.

<Popover><Popover.Trigger render={<Button variant="ghost" shape="square" icon={IconInfoCircle} aria-label="About" />} /><Popover.Content>  <p className="text-sm text-heyo-subtle">    Requests are counted per region, including cache hits.  </p></Popover.Content></Popover>

Placement

side and align set the preferred position; it flips and shifts on its own when the space is not there.

<Popover.Content side="right" align="start" sideOffset={8}>…</Popover.Content>

Properties

Popover

Base UI's root: open, defaultOpen, onOpenChange, plus the usual interaction props.

Popover.Content

titleReactNodeoptional

A heading above the content. Its presence also adds the close button.

descriptionReactNodeoptional

A muted line under the title.

showClosebooleanoptional

Forces the close button on or off.

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

Preferred placement.

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

Alignment against the trigger.

sideOffsetnumberoptional

Gap between trigger and popup, in pixels.

positionerPopover.Positioner.Propsoptional

Escape hatch for anything else the positioner supports.

classNamestringoptional

Merged into the popup — a different width, more padding.

The rest

Popover.Triggerrenderoptional

Anything that opens it.

Popover.Closerenderoptional

Closes it from inside the content.

Popover.Title / Description—optional

The raw parts, when you would rather build the header yourself.