Description

SearchBox provides a dedicated input field for searching through content. It is designed to capture search queries either when the user presses "Enter" or automatically as they type. Being a part of the Components group, it offers customization options such as underlining, custom icons, disabled states, and more. Use the SearchBox when you need an interactive search input that supports user-triggered search events.

Usage

To instantiate a SearchBox, use the static helper method from Tesserae.UI. You can chain various methods to configure its appearance and behavior, including setting placeholder text, enabling a "search as you type" mode, customizing the icon, and handling the search event.

A trailing clear button appears whenever the box holds text, whether or not it is focused, and needs no setup: pressing it empties the box, keeps the caret in it and raises OnSearch with the empty query. Clear() does the same from code. The button is drawn by the toolkit rather than by the browser, so it looks the same in every browser instead of only appearing in Chromium in the browser's own colour and weight.

The input is only as tall as its text and sits centred in a box roughly twice its height, so most of what looks like the search box is the container around it. A press anywhere in that container focuses the input, and a box already holding the caret keeps it where it is.

Below is a simple example demonstrating how to create a SearchBox:

API reference

Samples

Basic SearchBox with Underline and Search-as-You-Type

The following sample demonstrates the creation of a SearchBox that is underlined, triggers search events automatically as the user types, and displays an alert with the search query.

See also

  • TextBox – The basic text input component that forms the foundation of the SearchBox.
  • Button – Often used in conjunction with search inputs for initiating search actions manually.
© 2026 Curiosity. All rights reserved.