Skip to content
OVERLAYS · FREE

Dialog

Focused dialogs that keep users on track and work with the keyboard.

Focused dialogs that keep users on track. Focus moves inside, stays there until the dialog closes, and returns to where it was.

Why it helps

  • Focus handled
  • Escape and backdrop close
  • Show any component

Where it fits

  • Confirmations
  • Editing forms
  • Prompts
Dialog control in a RayCraft page

Example

<Button OnClick="() => _open = true">Open dialog</Button>

<Dialog @bind-Open="_open" Title="Delete item?">
    <ChildContent>This action cannot be undone.</ChildContent>
    <Actions>
        <Button Variant="Variant.Outlined" OnClick="() => _open = false">Cancel</Button>
        <Button OnClick="() => _open = false">Delete</Button>
    </Actions>
</Dialog>

@code {
    private bool _open;
}

A short fragment. Add @using RayCraft.Blazor.Components to your page and use an interactive render mode.

Included in RayCraft Free. Working examples are in the GitHub repository (MIT); it holds example and demo code, not the library code.

All controls ยท Documentation