Tesserae

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).

Constructors

Constructor
Dialog
public Dialog(IComponent content = null, IComponent title = null, bool centerContent = true)

Initializes a new instance of this class.

Properties

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

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 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 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 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 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 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 Tesserae. All rights reserved.