Animated Tabs

Tabs with an indicator that glides to the active tab. Full keyboard support.

no dependenciesMIT · free

Overview

Everything at a glance.

Preview

Underline variant.

Installation

npx shadcn@latest add https://ombakui.com/r/animated-tabs.json

Usage

import { AnimatedTabs } from "@/components/animated-tabs";

<AnimatedTabs
  tabs={[
    { label: "Overview", content: <Overview /> },
    { label: "Activity", content: <Activity /> },
  ]}
/>

Props

PropTypeDefaultDescription
tabs*TabItem[]–The tabs, in order.
defaultIndexnumber0Index of the tab that starts active.
onChange(index: number) => void–Called with the new index when the active tab changes.
variant"pill" | "underline""pill""pill" slides a filled pill; "underline" slides a line.
classNamestring–