Animated Tab Background
Animated Tab Background is a React and Tailwind CSS component from Motion Primitives, licensed MIT. Copy it and paste it into your project.
Motion Primitives
MIT
other
What it is
Animated Tab Background is a React and Tailwind CSS 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 SegmentedControl() {
return (
<div className='rounded-[8px] bg-gray-100 p-[2px] dark:bg-zinc-800'>
<AnimatedBackground
defaultValue='Day'
className='rounded-lg bg-white dark:bg-zinc-700'
transition={{
ease: 'easeInOut',
duration: 0.2,
}}
>
{['Day', 'Week', 'Month', 'Year'].map((label, index) => {
return (
<button
key={index}
data-id={label}
type='button'
aria-label={`${label} view`}
className='inline-flex w-20 items-center justify-center text-center text-zinc-800 transition-transform active:scale-[0.98] dark:text-zinc-50'
>
{label}
</button>
);
})}
</AnimatedBackground>
</div>
);
}