Table of Contents

Class ChatMessageAction

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

A single actionable button attached to a chat message's footer. The host owns what the action does via OnClick; the control renders and dispatches it.

public sealed record ChatMessageAction : IEquatable<ChatMessageAction>
Inheritance
ChatMessageAction
Implements
Inherited Members
Extension Methods

Properties

AfterPress

For non-toggle actions: what happens to the actions row after a press.

public ChatActionAfterPress AfterPress { get; init; }

Property Value

ChatActionAfterPress

Enabled

Whether the button is enabled.

public bool Enabled { get; init; }

Property Value

bool

Group

Optional grouping key; a separator is drawn between adjacent groups.

public string? Group { get; init; }

Property Value

string

Icon

Optional leading glyph (e.g. a narrow icon). Prepended to the label.

public string? Icon { get; init; }

Property Value

string

Id

Stable identifier — used for state updates, toggle restore, and removal.

public required string Id { get; init; }

Property Value

string

IsPressed

For Toggle: the initial pressed state.

public bool IsPressed { get; init; }

Property Value

bool

Label

Button text (markup allowed).

public required string Label { get; init; }

Property Value

string

OnClick

Synchronous click handler. Receives a context to set status / hide actions / toggle.

public Action<ChatActionContext>? OnClick { get; init; }

Property Value

Action<ChatActionContext>

OnClickAsync

Asynchronous click handler (used instead of / in addition to OnClick).

public Func<ChatActionContext, Task>? OnClickAsync { get; init; }

Property Value

Func<ChatActionContext, Task>

Variant

Visual variant. Toggle makes it a stateful on/off button.

public ChatActionVariant Variant { get; init; }

Property Value

ChatActionVariant