Skip to main content

Form

Family: Inputs & Forms
Namespace: Tessera.Controls

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

When to use

  • You want explicit rows with labels and controls.
  • Validation/readability matter more than dense freeform layout.

Minimal usage

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

var name = new TextInput { PlaceholderText = "Order name" };
var qty = new NumberInput { Value = 1, MinValue = 1, MaxValue = 999 };
var submit = new Button { Text = "Create order" };

var form = new Form
{
    Title = "Create order",
    Fields =
    {
        FormField.Row("Name", name),
        FormField.Row("Quantity", qty),
        FormField.Row(string.Empty, submit)
    }
};

return Screen.Build(window => window.Body(body => body.Center(form, width: 56, height: 13)));

Common pitfalls

  • Use DataForm<TModel> when you need model-bound field registration.
  • Avoid deeply nested forms; split into sections with FieldSet.

Public properties

PropertyType
BorderBorderStyle
BorderStyleTextTesseraStyle
DisabledStyleTesseraStyle
EmptyStyleTesseraStyle
EmptyTextstring
FocusedBorderStyleTextTesseraStyle
FocusedSelectedRowStyleTesseraStyle
FocusedTitleStyleTesseraStyle
FocusMarkerstring
HoveredRowStyleTesseraStyle
IsDisabledbool
IsFocusedbool
IsReadOnlybool
LabelStyleTesseraStyle
PaddingThickness
RequiredMarkerstring
RequiredMarkerStyleTesseraStyle
SelectedIndexint
SelectedMarkerstring
SelectedRowStyleTesseraStyle
ShowFocusMarkerbool
Titlestring
TitlePrefixstring
TitleStyleTesseraStyle
TitleSuffixstring
UnselectedMarkerstring
ValueStyleTesseraStyle

Public events

EventType
SelectionChangedEventHandler<ListSelectionChangedEventArgs<FormField>>?