themeocean

Animated Tabs

Navigation

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>
  );
}

Dependencies

More by themeocean

View all
  • Interactive Tech Stack Bento Grid with Hover Effects

    Interactive Tech Stack Bento Grid with Hover Effects

    780
  • Floating Glassmorphic Navbar with Morphing Pill Indicator

    Floating Glassmorphic Navbar with Morphing Pill Indicator

    87
  • Mac-Style Floating Dock

    Mac-Style Floating Dock

    79
  • Nexus 3D Animated Login - Futuristic Authentication UI

    Nexus 3D Animated Login - Futuristic Authentication UI

    72
  • Animated 3D Perspective Hero with Floating Glass Layers

    Animated 3D Perspective Hero with Floating Glass Layers

    51
  • Interactive AI Agent Workflow Node Card

    Interactive AI Agent Workflow Node Card

    38
  • Interactive LLM Token & Context Window Visualizer

    Interactive LLM Token & Context Window Visualizer

    31
  • Interactive AI Voice Assistant Audio Visualizer

    Interactive AI Voice Assistant Audio Visualizer

    24

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    171
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    449
  • Meniscus — Liquid Bottom Navigation Bar

    Meniscus — Liquid Bottom Navigation Bar

    33
  • Sidebar

    Sidebar

    444
  • Stacked Circular Footer

    Stacked Circular Footer

    470
  • Tabs

    Tabs

    38
  • Sidebar

    Sidebar

    367
  • Footer Section

    Footer Section

    3