Skip to content
VenusUI
Get started

Animated Tabs

Tabs with a sliding underline and fading panels, following the WAI-ARIA tabs pattern.

Preview

Installation

npx shadcn@latest add @venusui/animated-tabs

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/animated-tabs.tsx

Usage

The code behind the preview above.

animated-tabs-demo.tsx

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

export default function AnimatedTabsDemo() {
  return (
    <AnimatedTabs
      label="Account"
      className="max-w-md"
      tabs={[
        { value: "overview", label: "Overview", content: <p className="text-sm text-muted-foreground">Usage, plan and recent activity at a glance.</p> },
        { value: "billing", label: "Billing", content: <p className="text-sm text-muted-foreground">Invoices, payment methods and tax details.</p> },
        { value: "team", label: "Team", content: <p className="text-sm text-muted-foreground">Invite people and manage roles.</p> },
      ]}
    />
  )
}

API reference

PropTypeDefaultDescription
tabs{ value: string; label: ReactNode; content: ReactNode }[]—Tabs and their panels. Required.
labelstring—Accessible name for the tab list. Required.
defaultValuestringfirst tabInitially selected tab.
onValueChange(value: string) => void—Called when the selection changes.
classNamestring—Classes for the wrapper.

Only the props above.

Requirements

  • The motion package. The CLI installs it.
  • React 19 and Tailwind CSS v4.

Customization

  • Put icons in label alongside text.
  • For a pill style, replace the underline classes with inset-0 rounded-md bg-muted.

Accessibility

  • Implements the WAI-ARIA tabs pattern: arrow keys, Home and End switch tabs; each panel is labelled by its tab.
  • No sliding or fading with reduced motion.

Troubleshooting

Two tab sets animate into each other.
Each instance has its own layout group; if you copy the underline elsewhere, give it a unique layoutId.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

Dock

Navigation

A row of icons that magnify as the mouse approaches, like the macOS dock.

Loading preview

A single-choice switcher with a highlight that slides to the selected option.

Loading preview

A CSS-only cube with six content faces that tumbles slowly and pauses on hover.