Skip to main content

SearchBox

Family: Navigation & Workflow
Namespace: Tessera.Controls

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

When to use

  • Inline search with explicit next/prev match navigation.
  • You need query state as a first-class part of the shell.

Minimal usage

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

var search = new SearchBox
{
    Title = "Search slice",
    Placeholder = "entity, owner, region",
    MatchCount = 3,
    CurrentMatch = 1
};

var status = new StatusBar { LeftText = "Search ready" };
search.QueryChanged += (_, e) => status.LeftText = $"Query: {e.Query}";
search.NavigationRequested += (_, e) => status.LeftText = $"Navigate: {e.Direction}";

return Screen.Build(window =>
{
    window.Footer(1, status);
    window.Body(body => body.Center(search, width: 68, height: 4));
});

Common pitfalls

  • Debounce expensive searches; avoid blocking UI loop per keystroke.
  • Show match count and current index so navigation is predictable.

Public properties

PropertyType
BorderBorderStyle
BorderStyleTextTesseraStyle
CurrentMatchIndexint?
DisabledNavigationLabelStyleTesseraStyle
FocusedBorderStyleTextTesseraStyle
FocusedTitleStyleTesseraStyle
FocusMarkerstring
IsDisabledbool
IsFocusedbool
IsReadOnlybool
MatchCounterStyleTesseraStyle
MatchHighlightStyleTesseraStyle
NavigationLabelStyleTesseraStyle
NextLabelstring
PaddingThickness
PlaceholderTextStyleTesseraStyle
PreviousLabelstring
ShowFocusMarkerbool
ShowNavigationLabelsbool
Titlestring
TitleStyleTesseraStyle
ValueTextStyleTesseraStyle

Public events

EventType
NavigationRequestedEventHandler<SearchBoxNavigationRequestedEventArgs>?
QueryChangedEventHandler<SearchBoxQueryChangedEventArgs>?