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:

API reference

class

SearchableGroupedList<T>

public class SearchableGroupedList<T> : IComponent, ISpecialCaseStyling where T : ISearchableGroupedItem

A searchable, scrollable list whose items are organized into named groups.

Constructors

Constructor
SearchableGroupedList
public SearchableGroupedList(T[] items, Func<string, IComponent> groupedItemHeaderGenerator, params UnitSize[] columns) : this(new ObservableList<T>(initialValues: items ?? new T[0]), groupedItemHeaderGenerator, columns)

Initializes a new instance of this class.

Constructor
SearchableGroupedList
public SearchableGroupedList(ObservableList<T> originalItems, Func<string, IComponent> groupedItemHeaderGenerator, params UnitSize[] columns)

Initializes a new instance of this class.

Properties

Property
SearchableGroupedList.StylingContainer
public HTMLElement StylingContainer

Gets or sets the styling container.

Property
SearchableGroupedList.PropagateToStackItemParent
public bool PropagateToStackItemParent

Gets or sets the propagate to stack item parent.

Property
SearchableGroupedList.Items
public ObservableList<IComponent> Items { get; }

Adds the given items to the component.

Methods

Method
SearchableGroupedList.WithNoResultsMessage
public SearchableGroupedList<T> WithNoResultsMessage(Func<IComponent> emptyListMessageGenerator)

Returns the component configured with the given no results message.

Method
SearchableGroupedList.WithGroupOrdering
public SearchableGroupedList<T> WithGroupOrdering(IComparer<string> groupComparer)

Returns the component configured with the given group ordering.

Method
SearchableGroupedList.SearchBox
public SearchableGroupedList<T> SearchBox(Action<SearchBox> sb)

Configures the inline search box using the supplied callback.

Method
SearchableGroupedList.CaptureSearchBox
public SearchableGroupedList<T> CaptureSearchBox(out SearchBox sb)

Captures the inline search box into the supplied variable for later reference.

Method
SearchableGroupedList.SetKeyboardShortcut
public SearchableGroupedList<T> SetKeyboardShortcut(params string[] keys)

Sets the keyboard shortcut of the component.

Method
SearchableGroupedList.BeforeSearchBox
public SearchableGroupedList<T> BeforeSearchBox(params IComponent[] beforeComponents)

Adds the given components before the inline search box.

Method
SearchableGroupedList.AfterSearchBox
public SearchableGroupedList<T> AfterSearchBox(params IComponent[] afterComponents)

Adds the given components after the inline search box.

Method
SearchableGroupedList.Virtualize
public SearchableGroupedList<T> Virtualize(UnitSize itemHeight)

Configures the component to virtualize.

Method
SearchableGroupedList.Render
public HTMLElement Render()

Renders the component's root HTML element.

Method
SearchableGroupedList.WithPagination
public SearchableGroupedList<T> WithPagination(int pageSize)

Returns the component configured with the given pagination.

interface

ISearchableGroupedItem

public interface ISearchableGroupedItem : ISearchableItem

Samples

Live-filtered Grouped List

This sample uses a dataset of 30 produce items spread across four groups. Type any term in the search box (for example "berry", "leaf", or "Fruits") and watch the list filter in real time — both the item name and the group name participate in matching.

Custom Group Ordering and Commands

WithGroupOrdering lets you control the display order of groups regardless of the order items arrive in. This sample also adds Filter and Add buttons around the search box, and uses a grid layout (three columns) for compact display.

See also

Referenced by

© 2026 Tesserae. All rights reserved.