Getting StartedInstall and bootstrap headless foundations 4
LayoutHeadless structural primitives for expandable and container patterns 6
OverlayHeadless modal and floating layer behavior 3
FeedbackHeadless notification and status communication patterns 5
FormHeadless input and selection contracts 17
UtilityReusable action, identity, and clipboard behavior 6
NavigationHeadless trails, trees, menus, and command surfaces 7

Tabs overview

The headless tabs primitive owns focus, selection, and panel visibility while you keep full control over the root element, tab markup, and panel presentation.

Imports

Bring in the root directive plus the list, trigger, and panel parts from primitives.

Primitive imports

ts
import { TngTabs, TngTab, TngTabList, TngTabPanel } from '@tailng-ui/primitives';

Structure

Build tabs with any host element you want, as long as the parts stay inside the same tngTabs root.

Basic tabs structure

html
<section tngTabs aria-label="Project sections" defaultValue="overview">
  <div tngTabList ariaLabel="Project sections">
    <button type="button" tngTab value="overview">Overview</button>
    <button type="button" tngTab value="activity">Activity</button>
  </div>

  <section tngTabPanel value="overview">Overview content</section>
  <section tngTabPanel value="activity">Activity content</section>
</section>

Style variants

The same tabs primitive rendered with owner-authored Plain-CSS and Tailwind shells.

Tabs primitive (Plain CSS)

Overview

Primitive-owned selection with owner-authored shell and panel copy.

Behavior baseline

  • Tabs use roving focus and reflect selection through data-selected.
  • Panels are hidden when inactive, and you can opt into lazy mount and unmount behavior from the root and panel parts.
  • The primitive does not impose wrapper visuals, trigger layout, or panel chrome. Those stay with the owner.