Tumble Tabs
Tabs shouldn't slide. They should roll. A solid square tumbles over its leading corner to the chosen tab, and each label inverts as the square passes over it.
Free. Create a free account to copy the source. Read the release note
Tumble Tabs
Live preview
Starter
For side projects and first launches.
- 3 projects
- Community support
- Light and dark
Pro
For one team shipping every week.
- Unlimited projects
- Priority support
- Version history
Team
For product teams that review together.
- Shared libraries
- Roles and approvals
- Audit log
Scale
For orgs with more than one brand.
- Single sign-on
- Custom limits
- Dedicated support
Click a plan, or focus the tabs and use the arrow keys.
Sign in free to see the code
Every file of Tumble Tabs, ready to copy. Free account, free forever. You come straight back here.
Any tab set
Billing toggle
Filter
Get it into your app
Three steps. Copy the files and you're done; nothing to install.
SoonCLI and MCP install
Step 1: Get it
The source is free with an account, free forever. You come straight back to this page.
Step 2: Add it
Paste the files into
src/components/motionbits/, keeping the paths.tumble-tabs/tumble-tabs.tsxtumble-tabs/tumble-tabs.cssquarter-turn.tstumble-tabs/index.ts
Needs react and react-dom. No other packages to install.
Step 3: Use it
Import it and drop it in. Usage and props are just below.
import { TumbleTabs } from "@/components/motionbits/tumble-tabs";
Usage
import { TumbleTabs } from "@/components/motionbits/tumble-tabs";
const tabs = [
{ id: "starter", label: "Starter", panel: <Plan name="Starter" /> },
{ id: "pro", label: "Pro", panel: <Plan name="Pro" /> },
{ id: "team", label: "Team", panel: <Plan name="Team" /> },
{ id: "scale", label: "Scale", panel: <Plan name="Scale" /> },
];
export function Plans() {
return (
<TumbleTabs
tabs={tabs}
defaultValue="starter"
size={96}
stepMs={110}
aria-label="Plans"
/>
);
}
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
tabs | { id: string; label: ReactNode; panel?: ReactNode }[] | — | The tabs, in order. Each panel shows under the strip while its tab is selected. |
value / defaultValue | string | — | Controlled or uncontrolled selected tab id. The first tab is selected by default. |
onValueChange | (id: string) => void | — | Called when the selection changes from a click or the keyboard. |
size | number | 72 | Side of each square tab in px. It shrinks to fit narrow containers. |
stepMs | number | 110 | Time for one 90° step. Longer jumps take one step per tab of distance. |
arc | number | 6 | Height of the hop, in px, on jumps of two or more tabs. |
panelTilt | number | 3 | Degrees the panel tips in from the landing corner. |
ref | TumbleTabsHandle | — | select(id, { seekMs }) and reset(id), for driving the control from code. |
Accessibility
- WAI-ARIA tabs: a tablist with roving tabindex, tabpanels tied to their tabs, and the selected tab exposed with aria-selected.
- Arrow keys move one tab and tumble one step. Home and End jump to the first and last tab.
- The inverted labels that ride inside the square are decorative and hidden from assistive technology.
- The focus ring rides the square, so it stays visible on the selected tab in both themes.
Motion
- The square rolls in 90° steps about its leading bottom corner, one step per tab of distance at 110ms a step.
- Long jumps add a 6px hop. On landing the corner dot pops (0.3s) and the square settles back 2° over 0.4s.
- Only transform and opacity animate, and every layer is composited, so the roll holds 60fps.
- With reduced motion the square moves instantly and fades in over 0.15s, and the panels crossfade.