Command Palette

Search for a command to run...

Docs
Pill Morph Tabs

Pill Morph Tabs

Elegant tab component with morphing pill indicator and glassmorphism effects

Loading...

Installation

Usage

import PillMorphTabs from "@/components/ruixen/pill-morph-tabs";
 
const tabItems = [
  { value: "overview", label: "Overview", panel: <div>Overview content</div> },
  { value: "features", label: "Features", panel: <div>Feature list</div> },
  { value: "pricing", label: "Pricing", panel: <div>Pricing & plans</div> },
  { value: "faq", label: "FAQ", panel: <div>FAQ content</div> },
];
 
export default function App() {
  return (
    <PillMorphTabs
      items={tabItems}
      defaultValue="overview"
      onValueChange={(value) => console.log(value)}
    />
  );
}

Props

PropTypeDefaultDescription
itemsPillTab[]Default itemsArray of tab items
defaultValuestringFirst itemDefault active tab value
onValueChangefunctionundefinedCallback when tab changes
classNamestring""Additional CSS classes

Features

  • Morphing Pill: Animated pill indicator that morphs between tabs
  • Glassmorphism: Semi-transparent background with backdrop blur
  • Expand Effect: Slight vertical expansion animation on tab change
  • Accessibility: Built on shadcn Tabs primitives for full keyboard support
  • Responsive: Automatically measures and adjusts to tab sizes

Types

interface PillTab {
  value: string;
  label: React.ReactNode;
  panel?: React.ReactNode;
}