TextButton
InputInteractive button component.
@using Spectre.Console
@using RazorConsole.Components
<p>Count: @count</p>
<TextButton Content="Click me" OnClick="HandleClick" BackgroundColor="Color.Grey" FocusedColor="Color.Blue" />
<div>
<Markup Content="hit enter to click the button" Foreground="Color.Green" />
</div>
@code {
private int count = 0;
private void HandleClick()
{
count++;
StateHasChanged();
}
}Parameters
5| Name | Type | Default | Description |
|---|---|---|---|
Behavior | |||
FocusOrder | Nullable<Int32> | — | Tab order for keyboard navigation. Lower values receive focus first. If null , natural document order is used. |
Appearance | |||
BackgroundColor | Color | — | Background color when not focused. Default is Default. |
FocusedColor | Color | — | Background color when focused. Default is DeepSkyBlue1. |
Events | |||
OnClick | EventCallback | — | Event callback invoked when the button is clicked. |
Common | |||
Content | String | — | Text content displayed on the button. |