Blazorise Modal API
Explore the Blazorise Modal API reference for parameters, events, methods, and related types.
For examples and usage guidance, see the Modal documentation.
API
Parameters
Modal
| Parameter | Default | Type |
|---|---|---|
Animated | true | bool |
Gets or sets whether the component has any animations. | ||
AnimationDuration | 150 | int |
Gets or sets the animation duration, in milliseconds. | ||
Centered | false | bool |
Centers the modal vertically. | ||
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this Modal. | ||
FocusTrap | true | bool |
Specifies if the modal should keep the input focus at all times. When unspecified, uses BlazoriseOptions.ModalFocusTrap, falling back to true. | ||
RenderMode | ModalRenderMode.Default | ModalRenderMode |
Specifies how the modal content will be rendered. Possible values: DefaultLazyLoadLazyReload | ||
Scrollable | false | bool |
Scrolls the modal content independent of the page itself. | ||
ScrollToTop | true | bool |
If true modal will scroll to top when opened. | ||
ShowBackdrop | true | bool |
Specifies the backdrop needs to be rendered for this Modal. | ||
Size | Default | ModalSize |
Changes the size of the modal. Possible values: DefaultSmallLargeExtraLargeFullscreen | ||
Visible | false | bool |
Specifies the visibility of modal dialog. The Visible parameter should only be used in .razor code. | ||
ModalContent
| Parameter | Default | Type |
|---|---|---|
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this ModalContent. | ||
ModalBody
| Parameter | Default | Type |
|---|---|---|
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this ModalBody. | ||
MaxHeight | null | int? |
Sets the maximum height of the modal body (in viewport size unit). | ||
ModalTitle
| Parameter | Default | Type |
|---|---|---|
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this ModalTitle. | ||
Size | Is4 | HeadingSize |
Specifies the title size. Possible values: Is1Is2Is3Is4Is5Is6 | ||
Events
Modal
| Event | Type |
|---|---|
Closed | EventCallback |
Occurs after the modal has closed. | |
Closing | Func<ModalClosingEventArgs, Task> |
Occurs before the modal is closed. | |
Opened | EventCallback |
Occurs after the modal has opened. | |
Opening | Func<ModalOpeningEventArgs, Task> |
Occurs before the modal is opened. | |
VisibleChanged | EventCallback<bool> |
Notifies when the modal visibility state changes. | |
Methods
Modal
| Method | Return | Parameters |
|---|---|---|
Close | Task | CloseReason closeReason |
Triggers the closable component to be closed.
| ||
Hide | Task | — |
Fires the modal dialog closure process.
| ||
IsSafeToClose | Task<bool> | string elementId, CloseReason closeReason, bool isChildClicked |
Finds if the closable component is ready to be closed.
| ||
Show | Task | — |
Starts the modal opening process.
| ||