Search

Search documentation

Popover

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

Installation

pnpm dlx shadcn@latest add @evolphin/popover

Usage

import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/components/ui/popover";
<Popover>
  <PopoverTrigger>Open</PopoverTrigger>
  <PopoverContent>Place content for the popover here.</PopoverContent>
</Popover>

Type Definitions

interface PopoverProps {
  /** The controlled open state of the popover */
  open?: boolean;
PopoverProps.open?: boolean | undefined

The controlled open state of the popover

/** The default open state when uncontrolled */ ?: boolean; /** Event handler called when the open state changes */ ?: (: boolean) => void; /** The modality of the popover */ ?: boolean; }

Examples

Default

API Reference

Popover

PropTypeDefaultDescription
openboolean-The controlled open state of the popover.
defaultOpenboolean-The default open state when uncontrolled.
onOpenChange(open: boolean) => void-Event handler called when the open state changes.
modalbooleanfalseThe modality of the popover.

PopoverTrigger

PropTypeDefaultDescription
asChildbooleanfalseChange the component to the HTML tag or custom component of the only child.

PopoverContent

PropTypeDefaultDescription
align`"start" \"center" \"end"`
sideOffsetnumber4The distance in pixels from the trigger.
classNamestring-Additional CSS classes

PopoverAnchor

PropTypeDefaultDescription
asChildbooleanfalseChange the component to the HTML tag or custom component of the only child.

On this page