Animated Tab Background
Animated Tab Background is a React and Tailwind CSS navigation component from Motion Primitives, licensed MIT. Copy it and paste it into your project.
Motion Primitives
MIT
navigation
What it is
Animated Tab Background is a React and Tailwind CSS navigation component from Motion Primitives, licensed MIT. Copy it and paste it into your project.
How to use it
Open it in the catalogue, press copy, and paste it into your project. The prompt you copy carries the code and the rules that tell your agent to reproduce it without changing anything.
Four free copies a week. No card.
No packages beyond the project baseline
Licence
This component comes from Motion Primitives and is redistributed under the MIT licence, which permits commercial use. The copyright notice travels with the code.
Animated Tab Background
import { AnimatedBackground } from '@/components/core/animated-background';
export function AnimatedTabsHover() {
const TABS = ['Home', 'About', 'Services', 'Contact'];
return (
<div className='flex flex-row'>
<AnimatedBackground
defaultValue={TABS[0]}
className='rounded-lg bg-zinc-100 dark:bg-zinc-800'
transition={{
type: 'spring',
bounce: 0.2,
duration: 0.3,
}}
enableHover
>
{TABS.map((tab, index) => (
<button
key={index}
data-id={tab}
type='button'
className='px-2 py-0.5 text-zinc-600 transition-colors duration-300 hover:text-zinc-950 dark:text-zinc-400 dark:hover:text-zinc-50'
>
{tab}
</button>
))}
</AnimatedBackground>
</div>
);
}