Skip to content

Popover

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

Extreme test samples
Use this entire row as the positioning anchor.

Keep the first popover open and resize the browser height to try collision flipping. The arrow moves to the edge nearest the trigger and turns to point toward it.

Interaction modes

Modal="PopoverModalMode.NonModal" is the default and leaves page focus, pointer interaction, and scrolling available. TrapFocus contains keyboard focus without blocking page scrolling or outside pointer interaction. Modal contains focus, locks document scrolling, and consumes pointer activation outside the open popover.

Include PopoverClose in focus-trapping content so keyboard and touch-screen-reader users have an explicit way to leave the surface. Use DefaultFocus on PopoverContent to choose the initial focus target.

A direct non-modal Popover also moves initial focus and loops Tab navigation, but it permits later focus outside. ShardUI follows the shadcn/Radix full-modal baseline: full modal mode always traps focus and locks scrolling, including on touch devices.

Accessibility and cancelable lifecycle

PopoverTitle and PopoverDescription automatically connect to their content. Explicit aria-labelledby takes precedence, while an explicit aria-describedby is preserved and supplemented with the registered description id.

Opening focus, closing focus, Escape, pointer-outside, focus-outside, and combined outside interactions expose cancelable callbacks. Call PreventDefault() to retain focus or keep the Popover open.

The opening animation waits until the content is positioned, so its full fade, zoom, and slide remain visible. Closing can complete even when the initial position is still pending. This applies to both interactive and static rendering.

Static SSR behavior

The normal Popover, PopoverTrigger, and PopoverContent composition is progressively enhanced during true static server rendering. The browser can toggle, position, animate, dismiss, and restore focus without a Blazor circuit. Custom passive anchors, nested popovers, native controls, PopoverClose, and all three interaction modes are supported.

In static SSR, Open is the initial server-rendered state. Later browser transitions do not invoke OpenChanged, OnClick, the .NET lifecycle callbacks, or update @bind-Open state on the server. Matching bubbling, cancelable shardui:popover-* browser events provide the no-circuit cancellation contract. A root AnchorId without a PopoverTrigger can position initially-open content, but ShardUI has no browser trigger to toggle it afterward.

Closed content remains serialized as hidden and inert markup so the browser can open it. Do not place authorization-sensitive or secret data in that markup. Use an interactive render mode when the interaction must execute .NET callbacks, validation, injected services, or server-held state changes.

An unhandled error has occurred. Reload 🗙

    Rejoining the server...

    Rejoin failed... trying again in seconds.

    Failed to rejoin.
    Please retry or reload the page.

    The session has been paused by the server.

    Failed to resume the session.
    Please reload the page.