Skip to content
Hazine

Tabs

1 of 6 shipped. Each take is a different structure, and the note under its title says how.

  • tabs

    One indicator element is measured against the active tab and moved, so no tab draws its own border. A row wider than its container scrolls, with paging buttons that stop at each end.

    shadcn add @hazine/tabs-underline-sliding-indicator

    Depends on tabs, lucide-react, class-variance-authority

Planned 5

  • Contained pill tabs

    Tabs sit inside an enclosed track with equal-width or hug-content sizing, and collapse to icon-only with tooltips and aria-labels below a container-query breakpoint.

  • Vertical tabs with descriptions

    Uses aria-orientation=vertical with Up and Down arrow navigation and two-line tab content, and restacks into a select element on narrow screens instead of a scrolling strip.

  • Tabs that become an accordion

    One items array drives two different structures chosen by a container query: tablist plus panel when wide, heading buttons with inline panels when narrow, with the open item carried across the switch.

  • Tabs with overflow more menu

    A ResizeObserver decides which tabs render inline and which move into a menu, and picking an overflowed tab swaps it into the last visible position so the active tab is always on screen.

  • Closable document tabs

    Tabs are added and removed at runtime: Delete or the close button removes a tab, focus moves to the next neighbour, unsaved tabs ask for confirmation, and the strip scrolls horizontally with edge fade masks.