Tesserae

DetailsList

Description

DetailsList is a robust component for displaying an information-rich collection of items. It extends the basic List capabilities by supporting features such as sorting, grouping, multiple selection, and pagination. This component is ideal for scenarios where a dense presentation of metadata is required, such as file explorers or order listings. It is part of the Collections group in Tesserae.

Usage

Instantiate a DetailsList using the static helper method from Tesserae.UI. You must provide one or more column definitions (using helpers like IconColumn and DetailsListColumn) and supply list items that implement the IDetailsListItem interface.

Below is a minimal example of how to create a DetailsList displaying file items:

Methods

  • Compact(): DetailsList
    Sets the list to a compact mode (typically rendering items at a smaller height).

  • WithEmptyMessage(Func emptyListMessageGenerator): DetailsList
    Specifies a function that generates a component to display when the list has no items.
    • Parameter: emptyListMessageGenerator – a function returning an IComponent to be rendered as an empty message.

  • WithPaginatedItems(Func<Task<TDetailsListItem[]>> getNextItemPage): DetailsList
    Enables pagination by allowing asynchronous loading of additional list items as the user scrolls.
    • Parameter: getNextItemPage – an asynchronous function that returns an array of new list items.

  • WithListItems(params TDetailsListItem[] listItems): DetailsList
    Adds list items to the component. If the list has already been rendered, it refreshes the displayed content.
    • Parameter: listItems – an array of items implementing IDetailsListItem.

  • SortedBy(string columnSortingKey): DetailsList
    Pre-sorts the list based on a provided column sorting key.
    • Parameter: columnSortingKey – the key representing the column used for sorting.

Properties

  • IsCompact (bool)
    Gets or sets whether the list is displayed in a compact style. Internally, setting this affects CSS classes to adjust row heights.

  • StylingContainer (HTMLElement)
    Returns the container element that holds the entire DetailsList, useful for applying additional styling.

  • PropagateToStackItemParent (bool)
    Indicates whether style propagations should be applied to the parent stack items; this is set to false by default.

Samples

Sortable DetailsList with 50 Items

This sample populates the list with 50 generated rows so sorting and scrolling are meaningful. Click any column header to re-sort, or click a row to fire its OnListItemClick event (shown via a toast).

DetailsList with Live Pagination

Combine WithPaginatedItems with a real async producer. Each scroll to the bottom appends another 10 rows, simulating remote loading with Task.Delay. A Toast reports each batch so the loading behavior is visible.

DetailsList with Empty Message

Use WithEmptyMessage to render a placeholder when no items are available. The delegate is only invoked when the list is empty, so it can be as elaborate as needed.

See also

© 2026 Tesserae. All rights reserved.