Tesserae

SearchableGroupedList

Description

SearchableGroupedList is a versatile collection component designed to render a list of items that can be grouped and searched. It provides built-in search functionality to filter items based on input terms and organizes them by their respective groups. Use this component when you need to display a categorized list that supports live searching over a finite set of items. It is part of the Collections group in the UI toolkit.

Usage

Create a SearchableGroupedList by providing an array or an observable list of items that implement the ISearchableGroupedItem interface, along with a function to generate a header component for each group. The component includes a search box that filters items in real time, and you can further customize its behavior, such as adding custom content before or after the search box or setting a custom “no results” message.

Below is an example of how to instantiate the component:

Methods

  • WithNoResultsMessage(Func emptyListMessageGenerator)
    Allows you to specify a custom component to display when no items match the search criteria.
    Parameter:
    • emptyListMessageGenerator: A delegate that returns an IComponent for the no-results display.

  • WithGroupOrdering(IComparer groupComparer)
    Sets a custom comparer to order the groups.
    Parameter:
    • groupComparer: An IComparer to control the order of groups.

  • SearchBox(Action sb)
    Provides access to the internal SearchBox to perform further customization, such as changing its placeholder text or styles.
    Parameter:
    • sb: An action to configure the SearchBox.

  • CaptureSearchBox(out SearchBox sb)
    Retrieves the reference to the internal SearchBox for additional modifications.
    Parameter:
    • sb: An output parameter that captures the SearchBox instance.

  • BeforeSearchBox(params IComponent[] beforeComponents)
    Adds additional UI components before the search box, such as buttons or labels.
    Parameter:
    • beforeComponents: An array of IComponent to display before the search box.

  • AfterSearchBox(params IComponent[] afterComponents)
    Adds additional UI components after the search box for enhanced controls or information.
    Parameter:
    • afterComponents: An array of IComponent to display after the search box.

Properties

  • ObservableList Items
    A list that holds the current set of rendered components (both headers and item components) as they are filtered and grouped.

  • HTMLElement StylingContainer
    Returns the root HTML element used for styling purposes. This container holds the inner elements of the component.

  • bool PropagateToStackItemParent
    Indicates whether styling should propagate to the parent stack container of the component. Always returns true.

Samples

Basic Grouped Searchable List

The following sample demonstrates how to create a searchable grouped list with a custom no-results message. In this example, items are grouped by category, and the search functionality filters items based on the provided search term.

Advanced Customization with Additional Buttons

This sample shows how to add extra commands before and after the search box to extend the searchable grouped list functionality:

See also

Referenced by

© 2026 Tesserae. All rights reserved.