Component packs › Tangram › Shape Toggle

Shape Toggle

Stopped, the pieces tile a square; playing, the same seven pieces tile a triangle pointing right.

Shape Toggle is a toggle from Tangram, a component pack with 6 tangram controls: Seven tangram pieces that rearrange into every state of your interface. Price: $2 for the whole pack.

Built with: square to play arrow, aria-pressed, one piece at a time.

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.

Shape Toggle props

PropTypeDefaultDescription
playingboolean
labelstringAccessible name, e.g. "Preview".
disabledboolean
onChange(playing: boolean) => void
theme"light" | "dark"
autoplaynumber | falseShowcase mode: toggles itself every N ms while visible.

Methods on the ref

Use it in React

import ShapeToggle from './ShapeToggle';

<ShapeToggle />

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

More in Tangram

Good for: 404 and empty states.