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

ParameterDefaultType
Animatedtruebool

Gets or sets whether the component has any animations.
AnimationDuration150int

Gets or sets the animation duration, in milliseconds.
Centeredfalsebool

Centers the modal vertically.
ChildContentnullRenderFragment

Specifies the content to be rendered inside this Modal.
FocusTraptruebool

Specifies if the modal should keep the input focus at all times.
When unspecified, uses BlazoriseOptions.ModalFocusTrap, falling back to true.
RenderModeModalRenderMode.DefaultModalRenderMode

Specifies how the modal content will be rendered.
Possible values:DefaultLazyLoadLazyReload
Scrollablefalsebool

Scrolls the modal content independent of the page itself.
ScrollToToptruebool

If true modal will scroll to top when opened.
ShowBackdroptruebool

Specifies the backdrop needs to be rendered for this Modal.
SizeDefaultModalSize

Changes the size of the modal.
Possible values:DefaultSmallLargeExtraLargeFullscreen
Visiblefalsebool

Specifies the visibility of modal dialog.
The Visible parameter should only be used in .razor code.

ModalContent

ParameterDefaultType
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ModalContent.

ModalBody

ParameterDefaultType
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ModalBody.
MaxHeightnullint?

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

ModalTitle

ParameterDefaultType
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ModalTitle.
SizeIs4HeadingSize

Specifies the title size.
Possible values:Is1Is2Is3Is4Is5Is6

Events

Modal

EventType
ClosedEventCallback

Occurs after the modal has closed.
ClosingFunc<ModalClosingEventArgs, Task>

Occurs before the modal is closed.
OpenedEventCallback

Occurs after the modal has opened.
OpeningFunc<ModalOpeningEventArgs, Task>

Occurs before the modal is opened.
VisibleChangedEventCallback<bool>

Notifies when the modal visibility state changes.

Methods

Modal

MethodReturnParameters
CloseTaskCloseReason closeReason

Triggers the closable component to be closed.
HideTask—

Fires the modal dialog closure process.
IsSafeToCloseTask<bool>string elementId, CloseReason closeReason, bool isChildClicked

Finds if the closable component is ready to be closed.
ShowTask—

Starts the modal opening process.
On this page