Animated Tabs
wise-ui/animated-tabsFreeComponent
Tabs with smooth animated indicator transitions.
Live preview
live · rendered by the registry
Rendered by wise-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://wise-ui.com/r/animated-tabs.jsonSource
1"use client"23import * as React from "react"4import { motion } from "motion/react"5import { cn } from "@/registry/wise-ui/lib/utils"67interface Tab {8 id: string9 label: string10 icon?: React.ReactNode11}1213interface AnimatedTabsProps {14 tabs: Tab[]15 activeTab: string16 onTabChange: (tabId: string) => void17 className?: string18}1920function AnimatedTabs({21 tabs,22 activeTab,23 onTabChange,24 className,25}: AnimatedTabsProps) {26 const layoutId = React.useId()2728 return (29 <div30 className={cn(31 "inline-flex items-center gap-1 rounded-lg border border-border bg-muted/50 p-1",32 className33 )}34 >35 {tabs.map((tab) => {36 const isActive = tab.id === activeTab37 return (38 <button39 key={tab.id}40 onClick={() => onTabChange(tab.id)}41 className={cn(42 "relative z-10 inline-flex cursor-pointer items-center gap-2 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",43 isActive44 ? "text-foreground"45 : "text-muted-foreground hover:text-foreground"46 )}47 >48 {isActive && (49 <motion.div50 layoutId={`tab-pill-${layoutId}`}51 className="absolute inset-0 rounded-md bg-background shadow-sm"52 transition={{ type: "spring", stiffness: 500, damping: 35 }}53 style={{ zIndex: -1 }}54 />55 )}56 {tab.icon && <span className="inline-flex shrink-0">{tab.icon}</span>}57 {tab.label}58 </button>59 )60 })}61 </div>62 )63}64AnimatedTabs.displayName = "AnimatedTabs"6566export { AnimatedTabs }67export type { AnimatedTabsProps, Tab }
What it pulls in
npm packages
Files it writes
More from wise-ui
All 20 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Border Beamborder-beam | wise-ui | Components | Free | 3 deps | |
| Data Tabledata-table | wise-ui | Components | Free | 3 deps | |
| Dockdock | wise-ui | Components | Free | 3 deps | |
| Dot Matrixdot-matrix | wise-ui | Components | Free | 2 deps | |
| Editable Texteditable-text | wise-ui | Components | Free | 4 deps | |
| Gradient Sidebargradient-sidebar | wise-ui | Components | Free | 3 deps | |
| Kanban Boardkanban-board | wise-ui | Components | Free | 6 deps | |
| Magnetic Buttonmagnetic-button | wise-ui | Components | Free | 3 deps |
