Blazorise Modal Provider API

Review the provider component and service methods used to create and manage modal instances.

For setup instructions and examples, see the Modal Provider documentation.

API

Parameters

Parameter Description TypeDefault
Animated

Determines whether the component has any animations. Global Option.

booltrue
AnimationDuration

Specifies the animation duration. Global Option.

int150
Centered

Centers the modal vertically.

Remarks

Only considered if UseModalStructure is set.

boolfalse
FocusTrap

Specifies if the modal should keep the input focus at all times. Global Option.

bool?null
ProviderName

Defines the provider name used by IModalService. When null or empty, this provider is used as the default provider.

string
RenderMode

Specifies how the modal content will be rendered. Global Option.

Possible values:Default, LazyLoad, LazyReload

ModalRenderModeModalRenderMode.Default
Scrollable

Scrolls the modal content independent of the page itself.

Remarks

Only considered if UseModalStructure is set.

boolfalse
ScrollToTop

If true modal will scroll to top when opened. Global Option.

booltrue
ShowBackdrop

Specifies the backdrop needs to be rendered for this Modal. Global Option.

booltrue
Size

Changes the size of the modal.

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

Remarks

Only considered if UseModalStructure is set.

ModalSizeModalSize.Default
Stateful

Keeps the ModalInstance in memory after it has been closed. Defaults to false.

boolfalse
UseModalStructure

Uses the modal standard structure, by setting this to true you are only in charge of providing the custom content. Defaults to true. Global Option.

booltrue

Events

Event Description Type
Closed

Occurs after the modal has closed. Global Option.

EventCallback
Closing

Occurs before the modal is closed. Global Option.

Func<ModalClosingEventArgs, Task>
Opened

Occurs after the modal has opened. Global Option.

EventCallback
Opening

Occurs before the modal is opened. Global Option.

Func<ModalOpeningEventArgs, Task>

IModalService

Properties

Property Description Type
ModalProvider Gets the default provider that manages modal instances. ModalProvider

Methods

Method DescriptionReturnParameters
SetModalProvider Sets the default modal provider. voidModalProvider modalProvider
RegisterModalProvider Registers a named provider, or the default provider when the name is empty. voidstring providerName, ModalProvider modalProvider
UnregisterModalProvider Unregisters a named or default provider. voidstring providerName, ModalProvider modalProvider
Show<TComponent> Shows a component in a modal. Overloads support a title, component parameters, and instance options. Task<ModalInstance>title, parameters, options (depending on overload)
Show Shows dynamically selected component content or a render fragment. Task<ModalInstance>component type or RenderFragment, with optional title and options
Show Reopens an existing modal instance. TaskModalInstance modalInstance
Hide Hides the latest modal, a modal from a named provider, or a specific instance. Taskprovider name or ModalInstance (optional)
GetInstances Returns the modal instances managed by the default provider. IEnumerable<ModalInstance>
Remove Removes a modal instance from its provider. TaskModalInstance modalInstance
Reset Clears the modal provider state and its tracked instances. Task
On this page