RizzyUI

Popover

RzPopover lets you render floating content that’s anchored to a trigger element—no page navigation or messy workarounds. Think tooltips, forms, or quick-access panels, all staying in view and behaving well across screen sizes.

Under the hood, this component ties together Alpine.js (for state and interactivity) and floating-ui (for robust positioning), so you don’t need to wrangle the DOM or manage pixel math yourself.

Basic Popover

Here’s a basic popover attached to a button. The popover contains a small form, but you can embed any interactive content you need—everything from menus to custom panels. Positioning and accessibility are automatic.

Source
<RzPopover>
    <PopoverTrigger>
        <RzButton Variant="ThemeVariant.Primary" AsChild>Open Popover</RzButton>
    </PopoverTrigger>
    <PopoverContent>
        <div class="grid gap-4">
            <div class="space-y-2">
                <h4 class="font-medium leading-none">Dimensions</h4>
                <p class="text-sm text-muted-foreground">
                    Set the dimensions for the layer.
                </p>
            </div>
            <div class="grid gap-2">
                <div class="grid grid-cols-3 items-center gap-4">
                    <label for="width">Width</label>
                    <input id="width" value="100%" class="col-span-2 h-8 input" />
                </div>
                <div class="grid grid-cols-3 items-center gap-4">
                    <label for="maxWidth">Max. width</label>
                    <input id="maxWidth" value="300px" class="col-span-2 h-8 input" />
                </div>
                <div class="grid grid-cols-3 items-center gap-4">
                    <label for="height">Height</label>
                    <input id="height" value="25px" class="col-span-2 h-8 input" />
                </div>
                <div class="grid grid-cols-3 items-center gap-4">
                    <label for="maxHeight">Max. height</label>
                    <input id="maxHeight" value="none" class="col-span-2 h-8 input" />
                </div>
            </div>
        </div>
    </PopoverContent>
</RzPopover>

RzPopover Component Parameters

Parameters at a glance: Customize RzPopover’s behavior and positioning by tweaking these properties. Most developers will only need the defaults, but the knobs are here if you want to fine-tune layout or accessibility.

PropertyDescriptionTypeDefault
PopoverTriggerRenderFragment – The trigger element users interact with to open the popover.RenderFragmentRequired
PopoverContentRenderFragment – Content displayed inside the floating popover panel.RenderFragmentRequired
AnchorAnchorPoint – Preferred placement (top, bottom, etc.) relative to the trigger.AnchorPointAnchorPoint.BottomStart
Offsetint – Pixel offset along the anchor axis.int4
CrossAxisOffsetint – Pixel offset on the cross axis (perpendicular to anchor).int0
AlignmentAxisOffsetint – Pixel offset for alignment axis, if used.int0
StrategyAnchorStrategy – Positioning mode. Use fixed if your trigger is in a scrollable container.AnchorStrategyAnchorStrategy.Absolute
EnableFlipbool – If true, popover will "flip" sides when needed to stay visible.booltrue
EnableShiftbool – If true, popover will shift along its axis to stay in the viewport.booltrue
ShiftPaddingint – Viewport padding in pixels before shifting kicks in.int8
AriaLabelstring? – Accessible label for the popover container.string?null