Dialog

Description

The Dialog component is a modal overlay that is used to display temporary content and gather user confirmation or input. It blocks interaction with the underlying application until it is dismissed. This component is ideal for quick, actionable interactions requiring a decision, such as confirmation dialogs or small forms.

Usage

Dialogs are created with a fluent interface using the Tesserae.UI static helper. You can customize the dialog's header, content, and command buttons. Additional features include dark overlay and draggable mode. The example below initializes a dialog with a title, content, and custom command buttons.

API reference

class

Dialog

public sealed class Dialog

A modal dialog with a title, body and configurable action buttons (OK / Cancel / custom).

Namespace
Tesserae

Constructors

NameDescription
DialogInitializes a new instance of this class.
Constructor
Dialog
public Dialog(IComponent content = null, IComponent title = null, bool centerContent = true)

Initializes a new instance of this class.

Properties

NameDescription
IsDraggableGets or sets a value indicating whether the component can be dragged by the user.
IsDarkGets or sets a value indicating whether the component uses the dark colour theme.
Property
Dialog.IsDraggable
public bool IsDraggable { get ; set ; }

Gets or sets a value indicating whether the component can be dragged by the user.

Property
Dialog.IsDark
public bool IsDark { get ; set ; }

Gets or sets a value indicating whether the component uses the dark colour theme.

Methods

NameDescription
TitleGets or sets the title of the component.
ContentSets the content rendered inside the surface.
CommandsAdds the given components to the dialog's command row.
DarkApplies the dark colour scheme to the component.
MinHeightGets or sets the CSS min-height of the component.
HeightGets or sets the CSS height of the component.
OkShows OK button actions on the dialog and wires up the callback.
OkCancelShows OK / Cancel button actions on the dialog and wires up the callbacks.
YesNoShows Yes / No button actions on the dialog and wires up the callbacks.
YesNoCancelShows Yes / No / Cancel button actions on the dialog and wires up the callbacks.
RetryCancelShows Retry / Cancel button actions on the dialog and wires up the callbacks.
ShowShows the component.
HideHides the component.
DraggableMakes the surface draggable.
OkAsyncAwaitable variant of Ok that resolves with the user's response.
OkCancelAsyncAwaitable variant of OkCancel that resolves with the user's response.
YesNoAsyncAwaitable variant of YesNo that resolves with the user's response.
YesNoCancelAsyncAwaitable variant of YesNoCancel that resolves with the user's response.
RetryCancelAsyncAwaitable variant of RetryCancel that resolves with the user's response.
Method
Dialog.Title
public Dialog Title(IComponent title)

Gets or sets the title of the component.

Method
Dialog.Content
public Dialog Content(IComponent content)

Sets the content rendered inside the surface.

Method
Dialog.Commands
public Dialog Commands(params IComponent[] content)

Adds the given components to the dialog's command row.

Method
Dialog.Dark
public Dialog Dark()

Applies the dark colour scheme to the component.

Method
Dialog.MinHeight
public Dialog MinHeight(UnitSize unitSize)

Gets or sets the CSS min-height of the component.

Method
Dialog.Height
public Dialog Height(UnitSize unitSize)

Gets or sets the CSS height of the component.

Method
Dialog.Ok
public void Ok(Action onOk, Func<Button, Button> btnOk = null)

Shows OK button actions on the dialog and wires up the callback.

Method
Dialog.OkCancel
public void OkCancel(Action onOk = null, Action onCancel = null, Func<Button, Button> btnOk = null, Func<Button, Button> btnCancel = null)

Shows OK / Cancel button actions on the dialog and wires up the callbacks.

Method
Dialog.YesNo
public void YesNo(Action onYes = null, Action onNo = null, Func<Button, Button> btnYes = null, Func<Button, Button> btnNo = null)

Shows Yes / No button actions on the dialog and wires up the callbacks.

Method
Dialog.YesNoCancel
public void YesNoCancel(Action onYes = null, Action onNo = null, Action onCancel = null, Func<Button, Button> btnYes = null, Func<Button, Button> btnNo = null, Func<Button, Button> btnCancel = null)

Shows Yes / No / Cancel button actions on the dialog and wires up the callbacks.

Method
Dialog.RetryCancel
public void RetryCancel(Action onRetry = null, Action onCancel = null, Func<Button, Button> btnRetry = null, Func<Button, Button> btnCancel = null)

Shows Retry / Cancel button actions on the dialog and wires up the callbacks.

Method
Dialog.Show
public void Show()

Shows the component.

Method
Dialog.Hide
public void Hide(Action onHidden = null)

Hides the component.

Method
Dialog.Draggable
public Dialog Draggable()

Makes the surface draggable.

Method
Dialog.OkAsync
public Task<Response> OkAsync(Func<Button, Button> btnOk = null)

Awaitable variant of Ok that resolves with the user's response.

Method
Dialog.OkCancelAsync
public Task<Response> OkCancelAsync(Func<Button, Button> btnOk = null, Func<Button, Button> btnCancel = null)

Awaitable variant of OkCancel that resolves with the user's response.

Method
Dialog.YesNoAsync
public Task<Response> YesNoAsync(Func<Button, Button> btnYes = null, Func<Button, Button> btnNo = null)

Awaitable variant of YesNo that resolves with the user's response.

Method
Dialog.YesNoCancelAsync
public Task<Response> YesNoCancelAsync(Func<Button, Button> btnYes = null, Func<Button, Button> btnNo = null, Func<Button, Button> btnCancel = null)

Awaitable variant of YesNoCancel that resolves with the user's response.

Method
Dialog.RetryCancelAsync
public Task<Response> RetryCancelAsync(Func<Button, Button> btnRetry = null, Func<Button, Button> btnCancel = null)

Awaitable variant of RetryCancel that resolves with the user's response.

Samples

Basic Dialog Example

This sample demonstrates how to create a simple dialog with a title, content, and command buttons. It also shows how to enable draggable functionality.

Using Confirmation Methods

This sample illustrates the usage of the built-in confirmation methods such as YesNo and YesNoCancel.

See also

© 2026 Curiosity. All rights reserved.