127 Components

Popover Card

Overlays

Floating anchored popover card with configurable side and alignment, spring scale-in physics, outside-click dismissal, and interactive toggle controls.

Installation

Install directly into your project using the shadcn CLI or copy the source code manually.

Requires:framer-motionlucide-reactclsxtailwind-merge
$npx shadcn@latest add "https://boseui.site/r/popover-card.json"

Props

TypeScript props supported by <PopoverCard />.

9 props
PropTypeDefaultDescription
triggerLabelstring"Display Settings"Label displayed inside the popover trigger button.
titlestring"Workspace Preferences"Header title displayed inside the floating card.
descriptionstring"Adjust real-time notification and layout behavior."Subtitle text displayed under the popover title.
side"top" | "bottom" | "left" | "right""bottom"Side of the trigger where the popover appears.
align"start" | "center" | "end""center"Alignment along the chosen side.
openboolean—Controlled open state for the popover.
onOpenChange(open: boolean) => void—Callback fired when the popover opens or closes.
childrenReact.ReactNode—Custom content rendered inside the popover body.
classNamestring—Additional Tailwind CSS classes for the wrapper.

Key Features

  • Configurable `side` (top, bottom, left, right) and `align` (start, center, end) positioning.
  • Outside click and Escape key listeners for immediate dismissal.
  • Includes interactive spring switch toggles out of the box when no custom children are passed.

Keyboard & Accessibility

  • Links trigger button to popover dialog via aria-expanded, aria-haspopup, and aria-controls.
  • Uses role='switch' and aria-checked on interactive preference toggles.
  • Respects prefers-reduced-motion for entry and exit animations.