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 | Description | Type | Default |
|---|---|---|---|
Animated |
Gets or sets whether the component has any animations. |
bool | true |
AnimationDuration |
Gets or sets the animation duration, in milliseconds. |
int | 150 |
Centered |
Centers the modal vertically. |
bool | false |
ChildContent |
Specifies the content to be rendered inside this Modal. |
RenderFragment | null |
FocusTrap |
Specifies if the modal should keep the input focus at all times. When not defined, the global ModalFocusTrap option is used, which defaults to |
bool | true |
RenderMode |
Specifies how the modal content will be rendered. Possible values: |
ModalRenderMode | ModalRenderMode.Default |
Scrollable |
Scrolls the modal content independent of the page itself. |
bool | false |
ScrollToTop |
If true modal will scroll to top when opened. |
bool | true |
ShowBackdrop |
Specifies the backdrop needs to be rendered for this Modal. |
bool | true |
Size |
Changes the size of the modal. Possible values: |
ModalSize | ModalSize.Default |
Visible |
Specifies the visibility of modal dialog. RemarksThe Visible parameter should only be used in .razor code. |
bool | false |
ModalContent
| Parameter | Description | Type | Default |
|---|---|---|---|
ChildContent |
Specifies the content to be rendered inside this ModalContent. |
RenderFragment | null |
ModalBody
| Parameter | Description | Type | Default |
|---|---|---|---|
ChildContent |
Specifies the content to be rendered inside this ModalBody. |
RenderFragment | null |
MaxHeight |
Sets the maximum height of the modal body (in viewport size unit). |
int? | null |
ModalTitle
| Parameter | Description | Type | Default |
|---|---|---|---|
ChildContent |
Specifies the content to be rendered inside this ModalTitle. |
RenderFragment | null |
Size |
Specifies the title size. Possible values: |
HeadingSize | HeadingSize.Is4 |
Events
Modal
| Event | Description | Type |
|---|---|---|
Closed |
Occurs after the modal has closed. |
EventCallback |
Closing |
Occurs before the modal is closed. |
Func<ModalClosingEventArgs, Task> |
Opened |
Occurs after the modal has opened. |
EventCallback |
Opening |
Occurs before the modal is opened. |
Func<ModalOpeningEventArgs, Task> |
VisibleChanged |
Notifies when the modal visibility state changes. |
EventCallback<bool> |
Methods
Modal
| Method | Description | Return | Parameters |
|---|---|---|---|
Close |
Triggers the closable component to be closed. | Task | CloseReason closeReason |
Hide |
Fires the modal dialog closure process. | Task | |
IsSafeToClose |
Finds if the closable component is ready to be closed. | Task<bool> | string elementId, CloseReason closeReason, bool isChildClicked |
Show |
Starts the modal opening process. | Task |