Direction aware tabs preview

Direction aware tabs

Tabs whose content slides in from the side you moved toward while the panel height springs to fit.

  • Group
    Tabs
  • Origin
    Adapted · Cult UI · source
  • License
    MIT
  • Added
    Oct 18
npx shadcn@latest add @deank/direction-aware-tabs

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { DirectionAwareTabs } from "@/registry/components/direction-aware-tabs/direction-aware-tabs";

<DirectionAwareTabs tabs={[/* … */]} />

Props

PropTypeDefaultDescription
tabsDirectionAwareTab[]
className?string
onChange?(id: number) => voidCalled with the new tab id.
defaultTab?numberInitially selected tab id. Defaults to the first tab.

When to use

Switching between a few content panels where the spatial direction helps orientation.

When not to use

Many tabs or tabs that must keep all panels mounted (forms).

Related

Segmented control · Floating dock