Skip to main content

Button

Family: Inputs & Forms
Namespace: Tessera.Controls

Use Button when this interaction is the best match for your screen workflow.

When to use

  • A primary action should be explicit and keyboard/pointer reachable.
  • You need a low-friction call-to-action in a form or shell footer.

Minimal usage

csharp.cs
using Tessera.Controls;
using Tessera.Layout;

var refresh = new Button { Text = "Refresh orders" };
var status = new StatusBar { LeftText = "Ready" };
var count = 12;

refresh.Activated += (_, _) =>
{
    count++;
    status.LeftText = $"Orders: {count}";
};

return Screen.Build(window =>
{
    window.Footer(1, status);
    window.Body(body => body.Center(refresh, width: 24, height: 3));
});

Common pitfalls

  • Avoid using Button for passive labels; use Label or Badge instead.
  • Do not hide business state changes in render-only code paths.

Public properties

PropertyType
ActivationCountint
Descriptionstring?
DisabledLabelStyleTesseraStyle
FocusedLabelStyleTesseraStyle
FocusedSurfaceStyleTesseraStyle
IsDisabledbool
IsFocusedbool
IsPressedbool
LabelPrefixstring
LabelStyleTesseraStyle
LabelSuffixstring
PaddingThickness
PressedLabelStyleTesseraStyle
PressedSurfaceStyleTesseraStyle
SurfaceStyleTesseraStyle
Textstring

Public events

EventType
ActivatedEventHandler?