RayCraftDocs
v1.0.3 raycraft.dev
On this page

Dialog

Free

Modal window. Focus moves into it and stays inside until it closes (Escape, the close button or a backdrop click); focus then returns to the previous element. From code, use IRayCraftDialogs.ConfirmAsync / AlertAsync for messages, PromptAsync for a text value (null when cancelled), or ShowAsync<TComponent> to show your own component; it receives a cascading DialogContext whose Close(data) and Cancel() finish the dialog. This needs one DialogHost in your layout.

Example

Dialog control

Parameters

ParameterTypeDescription
ActionsRenderFragmentButtons shown at the bottom of the dialog.
ChildContentRenderFragmentContent rendered inside the component.
ClassstringExtra CSS classes added to the root element.
OpenboolWhether the drawer is shown. Use with @bind-Open.
PersistentboolBackdrop clicks and Escape do not close the dialog.
StylestringInline style added to the root element.
TitlestringTitle text (drawer header, tab caption, column header, step caption).

Events

EventTypeDescription
OpenChangedEventCallback<bool>Raised when the drawer asks to close.

Package

Dialog is part of RayCraft Free. Package: RayCraft.Blazor. It comes from nuget.org. See Getting started.