Floating surface for compact context and secondary actions.
npx shadcn@latest add @iconiq/r-popover"use client";
import { Bell, BellRing } from "lucide-react";
import { useState } from "react";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/r-popover";
export function PopoverPreview() {
const [open, setOpen] = useState(false);
return (
<div className="flex flex-col items-center gap-5">
<Popover onOpenChange={setOpen} open={open}>
<PopoverTrigger asChild>
<button
aria-label="Open popover"
className="inline-flex size-12 items-center justify-center text-foreground transition-colors hover:text-neutral-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 dark:hover:text-neutral-300"
type="button"
>
<Bell className="size-4.5" />
</button>
</PopoverTrigger>
<PopoverContent className="w-[320px]">
<div className="space-y-3">
<div className="flex items-start gap-3">
<span className="mt-0.5 inline-flex size-9 items-center justify-center rounded-full bg-neutral-100 text-neutral-900 dark:bg-neutral-900 dark:text-neutral-100">
<BellRing className="size-4" />
</span>
<div className="space-y-1">
<p className="text-[15px] font-medium text-foreground">
Release reminder
</p>
<p className="text-[13px] leading-5 text-secondary">
Design review · 20 min
</p>
</div>
</div>
<p className="text-[14px] leading-6 text-secondary">
Final pass on motion, copy, and interaction polish is still open
before the build moves to sign-off.
</p>
</div>
</PopoverContent>
</Popover>
</div>
);
}openControlled open state on the Radix root when you want React state to own visibility.
Type boolean
defaultOpenUncontrolled initial state forwarded to the underlying Radix popover root.
Type boolean
onOpenChangeCalled whenever Radix requests a state change through the trigger, outside interaction, or escape handling.
Type (open: boolean) => void
childrenComposition surface for the trigger, optional anchor, and content primitives.
Type ReactNode
asChildLets you render your own button, link, or wrapper element without adding an extra DOM node.
Type boolean
childrenInteractive content rendered by the trigger primitive.
Type ReactNode
asChildLets you render your own anchor element without adding an extra DOM node.
Type boolean
childrenLayout content rendered by the anchor primitive.
Type ReactNode
openAccepted for backwards compatibility, but no longer required. The nearest `Popover` root state now drives content presence automatically.
Type boolean
childrenContent rendered inside the animated panel.
Type ReactNode
classNameMerged onto the motion.div panel for local width, spacing, or surface overrides.
Type string
alignForwarded to Radix Popover.Content to control horizontal alignment relative to the trigger or anchor.
Type "start" | "center" | "end"·Default center
sideOffsetForwarded to Radix Popover.Content to control the gap between the anchor and the floating panel.
Type number·Default 8
collisionPaddingAdds a little default breathing room from the viewport edge before collision handling nudges the popover inward.
Type number | Partial<Record<Side, number>>·Default 12
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: @radix-ui/react-popover, motion.
Uses the dedicated Radix Popover primitive for root, trigger, anchor, content, and portal ownership.
Preserves the same side-aware panel motion and size-aware content animation as the core popover.
The generated registry file is /r/r-popover.json.
Contact
Additionally, if you find any bug or issue, feel free to raise an issue.