Skip to content
Menu

Navigation

Shared-Layout Tab Switch

Shared-Layout Tab Switch: A row of plain text tabs where a solid pill background slides and resizes to match whichever tab is selected, using spring-driven shared-layout motion.

Using Shared-Layout Tab Switch

Shared-Layout Tab Switch uses the inline preview frame with a dark theme setting.

Customize the preview

These controls are passed to the demo. Defaults and limits describe the preview; consult the implementation for its full prop API.

ControlTypeDefaultPreview limits
selectedselectReactOptions: Home, React, Vue, Svelte
accentColorcolor#FFFFFFNo additional limit in the metadata.
pillRadiusnumber9From 4 to 16; step 1
Which frameworks are available for Shared-Layout Tab Switch?

Shared-Layout Tab Switch is available for React, Vue, Svelte, Astro, HTML. The live preview uses React; the source observations below apply to index.tsx. Check the selected port before relying on the same interactions.

What does Shared-Layout Tab Switch depend on?

The React metadata lists these npm dependencies beyond React: motion, clsx, tailwind-merge.

What accessibility details are visible in Shared-Layout Tab Switch?

The React source for Shared-Layout Tab Switch includes: native elements (button); attributes and handlers (aria-hidden, aria-label, aria-orientation, aria-selected, onKeyDown, tabIndex); explicit roles (tab, tablist); key comparisons (ArrowLeft, ArrowRight, End, Home). These are source observations. Verify accessible names, focus order and keyboard behavior in the composed page.

How does Shared-Layout Tab Switch handle reduced motion?

Shared-Layout Tab Switch reads the motion preference in its React source through useReducedMotion(). Preference-dependent expressions in index.tsx: spring: reduce ? { duration: 0 } : { type: "spring", stiffness: 460, damping: 32, mass: 0.85 }. Check the full implementation, shared styles and selected port with reduced motion enabled; these observations do not establish that every animation stops.

Connect your agent

Related open components