Tab Indicator

A pill that springs between the active tabs

Create tabs with a springy sliding indicator. A pill-shaped tab bar (fully rounded container with 4px inner padding and a hairline border) where the active tab's background is a dark pill that physically slides from the old tab to the newly selected one with a spring feel: it should slightly overshoot and settle (spring stiffness ~500, damping ~35, or an equivalent 300ms transition with cubic-bezier(0.34, 1.56, 0.64, 1)). Implementation options: a single absolutely positioned pill whose left/width are measured from the active tab and animated with the spring curve; or, with Framer Motion, give the pill layoutId so it morphs between tabs automatically. The active tab's text color flips to the light color over 200ms; inactive tabs keep the dark text. Accessibility: use role=tablist / role=tab with aria-selected, and support arrow key navigation between tabs. When prefers-reduced-motion is enabled, move the pill instantly without the spring. Build the component, not this demo of it. - Ambient motion that IS the component may loop: a drifting background, a marquee, a spinner while something is genuinely loading. - Do not add any timer, interval, loop or script that performs a person's action by itself. No auto-hover, no auto-click, no cycling through states, no pretend submitting, no replaying the interaction on a schedule. - Every state that answers a person waits for a real event from that person. - Placeholder copy and sample content are welcome. Simulated behaviour is not.

Rate it
0
0

We'd like to measure how the site gets used, with Google Analytics. It sets cookies. Everything the site needs to work runs either way. How we handle data