Tesserae

Pivot

Description

The Pivot component is a tab-based container used to organize and display content panels within a user interface. It allows users to switch between different views or sections by clicking on tab titles, with options to customize tab alignment (normal, justified, or centered) and to control caching of tab content. Use it when you need to present segmented information in a compact, navigable format.

Usage

Instantiate the Pivot component using the static helper method from the Tesserae.UI static class. Add tabs by chaining the .Pivot() method with a unique tab identifier, a title generated with PivotTitle(), and a function that returns the tab content. The Pivot component is designed to be highly configurable with additional style methods for layout management.

Below is a simple usage example:

API reference

class

Pivot

public sealed class Pivot : IComponent, ISpecialCaseStyling

A horizontal tabbed surface with one tab visible at a time.

Constructors

Constructor
Pivot
public Pivot()

Initializes a new instance of this class.

Properties

Property
Pivot.SelectedTab
public string SelectedTab

Gets or sets the selected tab.

Property
Pivot.StylingContainer
public HTMLElement StylingContainer { get; }

Gets or sets the styling container.

Property
Pivot.PropagateToStackItemParent
public bool PropagateToStackItemParent

Gets or sets the propagate to stack item parent.

Methods

Method
Pivot.Justified
public Pivot Justified()

Configures the component to justified.

Method
Pivot.Centered
public Pivot Centered()

Configures the component to centered.

Method
Pivot.HideIfSingle
public Pivot HideIfSingle()

Hides the if single.

Method
Pivot.EnableCtrlTabSwitching
public Pivot EnableCtrlTabSwitching()

Enables Ctrl+Alt+Right / Ctrl+Alt+Left to cycle through tabs in order while the pivot is mounted and focus is inside its container (or no element is focused). Safe to call multiple times — the handler is only registered once.

Method
Pivot.RefreshPivotSizes
public void RefreshPivotSizes()

Refreshes the pivot sizes.

Method
Pivot.RemoveTab
public void RemoveTab(string id)

Removes the given tab from the component.

Method
Pivot.OnBeforeNavigate
public Pivot OnBeforeNavigate(PivotEventHandler<PivotBeforeNavigateEvent> onBeforeNavigate)

Registers a callback invoked when the before navigate event fires.

Method
Pivot.OnNavigate
public Pivot OnNavigate(PivotEventHandler<PivotNavigateEvent> onNavigate)

Registers a callback invoked when the navigate event fires.

Method
Pivot.Select
public Pivot Select(string id, bool refresh = false)

Configures the component to select.

Method
Pivot.Render
public HTMLElement Render()

Renders the component's root HTML element.

Samples

Basic Pivot Usage Sample

This sample demonstrates creating a basic Pivot with three tabs. It sets up the Pivot, adds tabs with simple text content, applies centered tab alignment, and renders the component to the document body.

Advanced Usage: Cached vs. Not Cached Tabs

This sample shows how to configure tabs with caching options. Cached tabs store their content after the initial render to improve performance, while non-cached tabs re-render their content every time they are selected.

See also

© 2026 Tesserae. All rights reserved.