Our Blazor Popup component allows you to display a modal window that overlays the current view. Use the HeaderText and BodyText properties to specify text displayed in the header and body.
To show or close the Popup in code, implement two-way binding for the Visible property. Users can choose from the following options to close the Popup: click the Close button in the header, click outside the Popup's boundaries, or press Escape.
Enable the ShowFooter option to display the Popup footer.
If you specify the HeaderText, BodyText, and FooterText properties, the Popup component uses predefined appearance settings. To customize the window's content and appearance, you can use the following templates:
- HeaderContentTemplate, BodyContentTemplate, FooterContentTemplate - Allow you to customize Popup element content area. Predefined content alignment and paddings apply.
- HeaderTemplate, BodyTemplate, FooterTemplate - Allow you to customize the entire area of Popup elements. Predefined appearance does not apply.
The HorizontalAlignment and VerticalAlignment properties allow you to position the Popup on the screen. Specify the Width and Height properties to change the Popup's size.
Use the drop-down lists at the top of the demo card to change the Popup's position and width.
You can handle the following events to process show and close actions:
- Showing / Closing - Occur before the Popup is displayed/closed and allow you to cancel these actions.
- Shown / Closed - Occur after the Popup is displayed/closed.
In this demo, a second Popup component appears if you do not select the checkbox in the first Popup.