RadzenPopup Class

A component that displays its child content in a floating overlay anchored to a target element. Supports smart positioning, optional width syncing with the target, lazy rendering, and close-on-outside-click behavior.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenPopup

Implements

IComponent

IHandleEvent

IHandleAfterRender

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenPopup : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender

Examples

Toggle a popup relative to a button:

<RadzenButton Text="Open" Click="@(args => popup.ToggleAsync(button.Element))" @ref="button" />
<RadzenPopup @ref="popup" Lazy="true">
    Popup content
</RadzenPopup>
@code {
    RadzenButton button;
    RadzenPopup popup;
}

Constructors

RadzenPopuplink

A component that displays its child content in a floating overlay anchored to a target element. Supports smart positioning, optional width syncing with the target, lazy rendering, and close-on-outside-click behavior.

Declaration
public RadzenPopup()

Properties

AutoFocusFirstElementlink

Specifies whether the first element in the popup should be automatically focused.

Declaration
public bool AutoFocusFirstElement { get; set; }
Property Value
Type Description
boolSpecifies whether the first element in the popup should be automatically focused.

ChildContentlink

Gets or sets the content to be rendered inside the popup.

Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type Description
RenderFragmentGets or sets the content to be rendered inside the popup.

Closelink

Event callback triggered when the popup is closed.

Declaration
public EventCallback Close { get; set; }
Property Value
Type Description
EventCallbackEvent callback triggered when the popup is closed.

CloseOnClickOutsidelink

Specifies whether the popup should close when clicking outside of it.

Declaration
public bool CloseOnClickOutside { get; set; }
Property Value
Type Description
boolSpecifies whether the popup should close when clicking outside of it.

IsOpenlink

Gets a value indicating whether the popup is currently open.

Declaration
public bool IsOpen { get; }
Property Value
Type Description
boolGets a value indicating whether the popup is currently open.

Lazylink

Determines whether the popup content is rendered only when open.

Declaration
public bool Lazy { get; set; }
Property Value
Type Description
boolDetermines whether the popup content is rendered only when open.

Openlink

Event callback triggered when the popup is opened.

Declaration
public EventCallback Open { get; set; }
Property Value
Type Description
EventCallbackEvent callback triggered when the popup is opened.

PreventDefaultlink

Specifies whether to prevent the default action on mouse down.

Declaration
public bool PreventDefault { get; set; }
Property Value
Type Description
boolSpecifies whether to prevent the default action on mouse down.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

CloseAsynclink

Closes the popup.

Declaration
public Task CloseAsync(ElementReference target)
Parameters
Type Name Description
ElementReference target
Returns
Type Description
Task

CloseAsynclink

Closes the popup.

Declaration
public Task CloseAsync()
Returns
Type Description
Task

Disposelink

Declaration
public override void Dispose()

OnCloselink

Invoked from JavaScript to close the popup.

Declaration
public Task OnClose()
Returns
Type Description
Task

ToggleAsynclink

Toggles the popup open or closed.

Declaration
public Task ToggleAsync(ElementReference target, bool disableSmartPosition, bool syncWidth)
Parameters
Type Name Description
ElementReference target The target element reference.
bool disableSmartPosition Whether to disable smart positioning.
bool syncWidth Whether to synchronize the width of the popup with the target element.
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙