Skip to content
Overlays & Tooltips

Popover

Floating content anchored to a trigger.

Import

tsx
import { Popover } from "@cronus-ui/ui";
bash
npx cronus-ui add popover

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component PopoverDefault layout:inline style:popover {
  aria-label:"Details"
  label "Open"
  text "Popover body"
}

page "/audit/popover/default" type:custom {
  use PopoverDefault
}

API Reference

Generated from the component's exported types.

PopoverProps

Extends ComponentProps<typeof PopoverPrimitive.Root>

Skip PopoverProps props table
PropTypeDefaultDescription
open
boolean—Controlled open state.
defaultOpen
boolean—Uncontrolled initial open state.
onOpenChange
(open: boolean) => void—Called when the open state changes.
children
ReactNode—Contents of the component.
modal
boolean—When true, interaction outside the surface is blocked.

PopoverTriggerProps

Extends ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>

Skip PopoverTriggerProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PopoverAnchorProps

Extends ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor>

Skip PopoverAnchorProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PopoverContentProps

Extends ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>

Skip PopoverContentProps props table
PropTypeDefaultDescription
side
"top" | "right" | "bottom" | "left"—Preferred side of the trigger.
align
"start" | "center" | "end"—Alignment along the chosen side.
sideOffset
number—Distance in pixels from the trigger.
alignOffset
number—Offset along the alignment axis.
forceMount
boolean—Keep the node mounted when closed, for exit animation.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.