Tabs

Tabs with a solid indicator and panels that blur out then in.

tabs.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/tabs.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/tabs.json

3

Turn on the motion

npx @prequelui/cli@latest animate tabs

The CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.

Usage

Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.

tabs.tsx
import {
  Tabs,
  TabsList,
  TabsTrigger,
  TabsContent,
} from "@/components/prequelui/tabs";

export default function Demo() {
  return (
    <Tabs defaultValue="overview">
      <TabsList>
        <TabsTrigger value="overview">Overview</TabsTrigger>
        <TabsTrigger value="activity">Activity</TabsTrigger>
      </TabsList>
      <TabsContent value="overview" className="rounded-lg border p-4">
        A calm summary of the workspace.
      </TabsContent>
      <TabsContent value="activity" className="rounded-lg border p-4">
        Every change, in order.
      </TabsContent>
    </Tabs>
  );
}
import { Tabs } from "@/components/prequelui/tabs";

export function Variant() {
  return (
    <Tabs tempo={1.2}>
      …
    </Tabs>
  );
}

Animation

The indicator is one solid node that slides between labels; the panels behave like sheets. The old panel leaves in 150 ms with a 12 px shift and a 5 px blur while the new one arrives over it in 300 ms. The tab body glides to the new height.

  • Indicator spring: 300 / 30 on position and width.
  • Panel exit: 150 ms with a leftward 12 px shift and a 5 px blur.
  • Panel entry: 300 ms from the opposite shift.
  • Height settles on a 300 / 30 spring with no bounce.
  • Reduced motion removes the shift, blur and height glide.
spring 300 / 30panel out 150 mspanel in 300 msblur 5 px

API Reference

Every part takes exactly the props of the Tabs primitive. The animated surface adds only motion props, so the accessibility tree and keyboard behaviour stay the same.

Tabs

PropTypeDefault
valuestring—
defaultValuestring""
onValueChange(value: string) => void—
transitionTransitioncomponent spring or tween
classNamestring—

TabsList / TabsTrigger

PropTypeDefault
valuestring—
indicatorTransitionTransitionspring.selection
classNamestring—

TabsContent

PropTypeDefault
valuestring—
forceMountbooleanfalse
classNamestring—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026