Component packs › Ferro › Polarity Tabs

Polarity Tabs

A bar magnet slides under the tabs, stretching with speed, while a strip of filings swings round to follow its field.

Polarity Tabs is a tabs from Ferro, a component pack with 7 components: Components that behave like magnets. Price: $5 for the whole pack.

Built with: dipole filings, speed stretch, tablist keys.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Polarity Tabs props

PropTypeDefaultDescription
tabsPolarityTab[]
indexnumberIndex selected at start.
onChange(i: number) => voidCalled when the tab changes.
autoplaybooleanShowcase mode: steps through the tabs until touched.

Methods on the ref

Use it in React

import PolarityTabs from './PolarityTabs';

<PolarityTabs />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Ferro

Good for: Micro-interactions.