Popover

An interactive floating panel anchored to a trigger element.

Overview

Popover renders interactive floating content anchored to a trigger. Use it for focused controls, lightweight configuration, or short contextual workflows that need deliberate user interaction.

Popover content is surface-aware: it lands at parent +2 and uses the matching floating border and shadow for that surface level.

Usage

import { Button } from "@tilt-legal/cubitt-components/button";
import {
  Popover,
  PopoverClose,
  PopoverContent,
  PopoverDescription,
  PopoverTitle,
  PopoverTrigger,
} from "@tilt-legal/cubitt-components/popover";
<Popover>
  <PopoverTrigger render={<Button variant="secondary" />}>
    Show Popover
  </PopoverTrigger>
  <PopoverContent>
    <PopoverTitle>Premium Plan</PopoverTitle>
    <PopoverDescription>
      Advanced analytics provides deeper insights into your data.
    </PopoverDescription>
  </PopoverContent>
</Popover>

Examples

Basic

Click the trigger to open a popover with title, description, and dismiss control.

Positions

Popover content can be positioned on any side of the trigger.

Alignment

Popover content can align to the start, center, or end of the trigger.

API Reference

Popover

PropTypeDefaultDescription
openbooleanControlled open state.
defaultOpenbooleanfalseInitial open state for uncontrolled usage.
onOpenChange(open: boolean, eventDetails) => voidCallback fired when the open state changes.
modalbooleanfalseWhether interaction outside the popover is blocked.
disabledbooleanfalseWhether the popover is disabled.

PopoverTrigger

PropTypeDefaultDescription
renderReactElement | (props) => ReactElementCompose the trigger with another part.
classNamestringAdditional classes for the trigger.
disabledbooleanfalseWhether the trigger is disabled.

PopoverContent

PropTypeDefaultDescription
align"start" | "center" | "end""center"Alignment relative to the trigger.
side"top" | "right" | "bottom" | "left""bottom"Side of the trigger to position against.
sideOffsetnumber8Distance from the trigger.
alignOffsetnumber0Offset along the alignment axis.
anchorRefObject | Element | VirtualElementOptional custom positioning anchor.
positionMethod"absolute" | "fixed"Positioning strategy passed to Base UI.
classNamestringAdditional classes for the content surface.
childrenReactNodePopover content.

PopoverClose

PropTypeDefaultDescription
renderReactElement | (props) => ReactElementCompose the close control with another component.
classNamestringAdditional classes for the close control.
childrenReactNodeClose content. Defaults to an icon-only frost button.

PopoverTitle

PropTypeDefaultDescription
classNamestringAdditional classes for the title.
childrenReactNodeTitle content.

PopoverDescription

PropTypeDefaultDescription
classNamestringAdditional classes for the description.
childrenReactNodeDescription content.

PopoverAnchor

PropTypeDefaultDescription
classNamestringAdditional classes for the anchor span.

On this page