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 TypeDefault
Animated

Gets or sets whether the component has any animations.

booltrue
AnimationDuration

Gets or sets the animation duration, in milliseconds.

int150
Centered

Centers the modal vertically.

boolfalse
ChildContent

Specifies the content to be rendered inside this Modal.

RenderFragmentnull
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 true.

booltrue
RenderMode

Specifies how the modal content will be rendered.

Possible values:Default, LazyLoad, LazyReload

ModalRenderModeModalRenderMode.Default
Scrollable

Scrolls the modal content independent of the page itself.

boolfalse
ScrollToTop

If true modal will scroll to top when opened.

booltrue
ShowBackdrop

Specifies the backdrop needs to be rendered for this Modal.

booltrue
Size

Changes the size of the modal.

Possible values:Default, Small, Large, ExtraLarge, Fullscreen

ModalSizeModalSize.Default
Visible

Specifies the visibility of modal dialog.

Remarks

The Visible parameter should only be used in .razor code.

boolfalse

ModalContent

Parameter Description TypeDefault
ChildContent

Specifies the content to be rendered inside this ModalContent.

RenderFragmentnull

ModalBody

Parameter Description TypeDefault
ChildContent

Specifies the content to be rendered inside this ModalBody.

RenderFragmentnull
MaxHeight

Sets the maximum height of the modal body (in viewport size unit).

int?null

ModalTitle

Parameter Description TypeDefault
ChildContent

Specifies the content to be rendered inside this ModalTitle.

RenderFragmentnull
Size

Specifies the title size.

Possible values:Is1, Is2, Is3, Is4, Is5, Is6

HeadingSizeHeadingSize.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 DescriptionReturnParameters
Close Triggers the closable component to be closed. TaskCloseReason 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
On this page