The Tab headless controller offers a high-level interface for designing a common tab UI controller.

Example: tab.fn.tsx

interface Tab {
    state: TabState;
    select(): void;
    subscribe(listener: () => void): Unsubscribe;
}

Hierarchy (View Summary)

Methods

Properties

Methods

  • Activates the tab.

    Returns void

  • Adds a callback that's invoked on state change.

    Parameters

    • listener: () => void

      A callback that's invoked on state change.

    Returns Unsubscribe

    A function to remove the listener.

Properties

state: TabState

The state of the Tab controller.