About
Accessible tabs with a sliding indicator and direction-aware panel transitions. Supports arrow keys, Home and End, disabled tabs, count badges and two looks: underline and pill.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Animated Tabs to your project and fits it to your theme.
Code
How Animated Tabs is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
// This is a file with a demo for your component
// That's what users will see in the preview
// Create new files in this directory to add more demos
"use client";
import * as React from "react";
import { Component } from "@/components/ui/animated-tabs";
import { cn } from "@/lib/utils";
export default function DemoOne() {
const [variant, setVariant] = React.useState<"underline" | "pill">("underline");
return (
<div className="flex min-h-[520px] w-full flex-col items-center justify-center gap-8 bg-background px-4 py-14 text-foreground">
<div role="group" aria-label="Tab style" className="inline-flex rounded-full border border-border bg-card p-0.5">
{(["underline", "pill"] as const).map((v) => (
<button
key={v}
type="button"
aria-pressed={variant === v}
onClick={() => setVariant(v)}
className={cn(
"h-8 rounded-full px-4 text-xs font-medium capitalize transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
variant === v ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground"
)}
>
{v}
</button>
))}
</div>
<Component variant={variant} />
</div>
);
}
















