OverflowSet

Description

The OverflowSet component is a container designed to manage a set of UI items that may overflow the available display space. It automatically computes item widths and, when necessary, collapses excess items into an overflow menu (shown as a chevron button). Use this component when you need to display a dynamic list of elements that must adapt to constrained widths.

Usage

Instantiate the OverflowSet using the fluent interface provided by Tesserae.UI. Items can be added using the Items() method, which accepts multiple IComponent instances. The component automatically adds separators between items. Configure properties such as the overflow index or switch to a small variant using dedicated methods or properties.

Below is a minimal example demonstrating how to create an OverflowSet with several button items:

API reference

class

OverflowSet

public class OverflowSet : IComponent, IContainer<Breadcrumb, IComponent>

A horizontal set of items where any items that do not fit are automatically collapsed into an overflow menu.

Namespace
Tesserae
Implements
IComponent, IContainer<Breadcrumb, IComponent>

Constructors

NameDescription
OverflowSetInitializes a new instance of this class.
Constructor
OverflowSet
public OverflowSet()

Initializes a new instance of this class.

Properties

NameDescription
MaximumItemsToDisplayGets or sets the maximum items to display.
OverflowIndexGets or sets the overflow index.
IsSmallReturns a value indicating whether the component is small.
Property
OverflowSet.MaximumItemsToDisplay
public int MaximumItemsToDisplay { get ; set ; }

Gets or sets the maximum items to display.

Property
OverflowSet.OverflowIndex
public int OverflowIndex { get ; set ; }

Gets or sets the overflow index.

Property
OverflowSet.IsSmall
public bool IsSmall { get ; set ; }

Returns a value indicating whether the component is small.

Methods

NameDescription
JustifyContentSets the justify-content css property for this set
ClearClears the component's current state.
ReplaceReplaces an existing item with a new one.
AddAdds the given item to the component.
ItemsAdds the given items to the component.
DisableSizeCacheDisables the size cache on the component.
SetOverflowIndexSets the overflow index of the component.
SmallRenders the component at small size.
RenderRenders the component's root HTML element.
Method
OverflowSet.JustifyContent
public OverflowSet JustifyContent(ItemJustify justify)

Sets the justify-content css property for this set

Parameters

justify
Method
OverflowSet.Clear
public void Clear()

Clears the component's current state.

Method
OverflowSet.Replace
public void Replace(IComponent newComponent, IComponent oldComponent)

Replaces an existing item with a new one.

Method
OverflowSet.Add
public void Add(IComponent component)

Adds the given item to the component.

Method
OverflowSet.Items
public OverflowSet Items(params IComponent[] children)

Adds the given items to the component.

Method
OverflowSet.DisableSizeCache
public OverflowSet DisableSizeCache()

Disables the size cache on the component.

Method
OverflowSet.SetOverflowIndex
public OverflowSet SetOverflowIndex(int i)

Sets the overflow index of the component.

Method
OverflowSet.Small
public OverflowSet Small()

Renders the component at small size.

Method
OverflowSet.Render
public HTMLElement Render()

Renders the component's root HTML element.

Samples

Basic OverflowSet Example

In this sample, an OverflowSet is created with multiple button items. When the display area is constrained, excess items will collapse into an overflow menu rendered as a chevron button.

See Also

© 2026 Curiosity. All rights reserved.