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.
IComponent
IHandleEvent
IHandleAfterRender
RadzenComponent.GetComponentCssClass
RadzenComponent.SetParametersAsync
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.DefaultUICulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenPopup : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRenderToggle 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;
}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.
public RadzenPopup()Specifies whether the first element in the popup should be automatically focused.
public bool AutoFocusFirstElement { get; set; }
| Type | Description |
|---|---|
| bool | Specifies whether the first element in the popup should be automatically focused. |
Gets or sets the content to be rendered inside the popup.
public RenderFragment ChildContent { get; set; }
| Type | Description |
|---|---|
| RenderFragment | Gets or sets the content to be rendered inside the popup. |
Event callback triggered when the popup is closed.
public EventCallback Close { get; set; }
| Type | Description |
|---|---|
| EventCallback | Event callback triggered when the popup is closed. |
Specifies whether the popup should close when clicking outside of it.
public bool CloseOnClickOutside { get; set; }
| Type | Description |
|---|---|
| bool | Specifies whether the popup should close when clicking outside of it. |
Gets a value indicating whether the popup is currently open.
public bool IsOpen { get; }
| Type | Description |
|---|---|
| bool | Gets a value indicating whether the popup is currently open. |
Determines whether the popup content is rendered only when open.
public bool Lazy { get; set; }
| Type | Description |
|---|---|
| bool | Determines whether the popup content is rendered only when open. |
Event callback triggered when the popup is opened.
public EventCallback Open { get; set; }
| Type | Description |
|---|---|
| EventCallback | Event callback triggered when the popup is opened. |
Specifies whether to prevent the default action on mouse down.
public bool PreventDefault { get; set; }
| Type | Description |
|---|---|
| bool | Specifies whether to prevent the default action on mouse down. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
Closes the popup.
public Task CloseAsync(ElementReference target)
| Type | Name | Description |
|---|---|---|
| ElementReference | target |
| Type | Description |
|---|---|
| Task |
Invoked from JavaScript to close the popup.
public Task OnClose()
| Type | Description |
|---|---|
| Task |
Toggles the popup open or closed.
public Task ToggleAsync(ElementReference target, bool disableSmartPosition, bool syncWidth)
| 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. |
| Type | Description |
|---|---|
| Task |