ThatDesignUIOriginalInteractive preview
Animated tabs
A segmented tab bar whose indicator slides to the selected tab, with panels that slide in from the direction you moved and full keyboard support.
- Category
- Navigation
- Platform
- Responsive
Interactive componentClick through it, resize it, or switch states. It’s real UI, not a screenshot.Overview state
Use this component
Free to use. It works on its own in any React and Tailwind project, so you can add it with one command, paste the code, or hand the prompt to your coding agent.
FreeReact 18+Tailwind v3.4 or v4No extra packages
1. Add it with the shadcn CLI
npx shadcn@latest add https://www.thatdesignui.com/r/animated-tabs.json2. Use it
Every prop is optionalapp/page.tsx
import AnimatedTabs from "@/components/animated-tabs";
export default function Page() {
return <AnimatedTabs />;
}Prefer to paste it yourself? Open the .
Under the hood
How it’s built
What’s inside
- A 44rem-wide segmented bar on #ececf2 (16px radius, 4px inset) with four equal tabs, each an icon and a label; a white indicator with a soft shadow slides under the selected tab.
- Below, the panel for the tab fades and slides 14px in from the side you moved toward: stat cards, a gradient bar chart, a list of reports with status tags, or a list of settings with switches.
How it behaves
- Left/Right arrows move to and select the neighbouring tab (wrapping), Home and End jump to the ends, and focus follows.
- Only the selected tab is in the tab order; tabs use role=tab with aria-selected and aria-controls, panels use role=tabpanel.
- The indicator lands exactly under the selected tab at every width.
- No sliding under reduced motion; the selection still changes.



