Popover

An interactive floating panel anchored to a trigger element, used for actions, forms, and controls that require user input.

Overview

The Popover component renders an interactive floating panel that opens when the user clicks a trigger. It's designed for content that requires deliberate interaction — filters, configuration, confirmations, or any workflow where the user needs to take action before dismissing.

Usage

import { Popover, PopoverTrigger, PopoverContent } from "@tilt-legal/cubitt-components/primitives";
<Popover>
  <PopoverTrigger render={<Button />}>Open Popover</PopoverTrigger>
  <PopoverContent>
    <p>Popover content goes here</p>
  </PopoverContent>
</Popover>

Examples

Basic

Click the trigger to open a popover with interactive content.

Positions

Popover positioned on different sides of the trigger.

Alignment

Different alignment options relative to the trigger.

API Reference

Popover

The root component that manages the popover state.

PropTypeDescription
openbooleanWhether the popover is currently open (controlled).
defaultOpenbooleanWhether the popover is initially open (uncontrolled). Defaults to false.
onOpenChange(open: boolean, eventDetails) => voidCallback fired when the open state changes.
modalbooleanWhether the popover is modal. Defaults to false.
disabledbooleanWhether the popover is disabled. Defaults to false.

PopoverTrigger

The element that toggles the popover on click.

PropTypeDescription
classNamestringAdditional CSS classes for the trigger.
renderReactElement | (props) => ReactElementAllows composing the trigger with another component. Receives props to spread.
disabledbooleanWhether the trigger is disabled. Defaults to false.

PopoverContent

The container for the popover content, positioned relative to the trigger.

PropTypeDescription
classNamestringAdditional CSS classes for the content.
align"start" | "center" | "end"Alignment relative to the trigger. Defaults to "center".
side"top" | "right" | "bottom" | "left"Which side of the trigger to position. Defaults to "bottom".
sideOffsetnumberDistance in pixels from the trigger. Defaults to 8.
alignOffsetnumberOffset in pixels along the alignment axis. Defaults to 0.

PopoverAnchor

An optional anchor element for positioning the popover.

PropTypeDescription
classNamestringAdditional CSS classes for the anchor.

On this page