A short word or status built from tangram pieces: letters fold into tangram squares on hover, and a status change rearranges the squares into the new word.
Use for a short word of about six characters, A to Z and 0 to 9, that carries a state or identity. Hover or focus folds it into squares; a status prop rearranges them into the new word.
When not to use
Not for long text or lowercase words. For a small status chip use Status Badge; for a number that changes use Number Ticker.
Use Tangram Word for a short word that carries a state or an identity: a deploy status, a room code, a workspace name. Each capital is a geometric letter cut into seven flat pieces. On hover, focus or tap the pieces part and fly, letter by letter, into the tangram square, then land back as the word when the person leaves. Driven by status, it becomes a status word: when the state changes, the old word folds into its squares and the squares rearrange into the new word. It takes about six characters, A to Z, 0 to 9 and spaces, at a cap height of 32 to 240px. For a sentence, a lowercase heading or text that has to be selected, use plain text.
import { TangramWord } from "@/components/ui/tangram-word"export function DeployStatus() { return <TangramWord size={128}>LIVE</TangramWord>}
children is a plain string. The word is drawn as an SVG and a screen-reader-only copy of the text sits next to it. The word scales down to fit a narrower container. size is the cap height in px (32 to 240, default 96); ink sets the color of the word (default foreground).
The squares take their hue from your --primary when it has color and from --brand when --primary is a neutral gray, so the squares always read as colored. Pass tint to choose another color; the lightness of the seven pieces is set per theme for contrast.
Presets change what the hover does and how the pieces are colored, never the drawing:
fold (default): an ink word that folds into the tangram squares.
mosaic: the pieces keep their seven tints at rest too.
seams: the pieces only part and lift; the word never folds.
gap (0 to 8px) sets how far the cuts open on the charge.
To show the squares from your own state, control it: active true shows the squares and hover does nothing; undefined leaves the word to hover, focus and tap.
status draws a word from a status set and animates every change. By default live, building, failed and paused draw LIVE, BUILD, FAILED and PAUSED; pass statuses to use your own words. When the status changes, the old word folds letter by letter into its tangram squares, the extra squares shrink away (or the missing ones grow in), and the squares unfold as the new word. The new letters land on the old letters' square orientations, so the hand-over inside the squares is seamless.
With status, the SVG reserves the width of the widest word in the set, so the layout never moves when the word changes. For a plain children word that changes, pass the words to reserve with reserve. Changing children animates the same way as status.
Set the character for the whole app with MotionKitProvider, or per instance with temperament (calm, lively, playful). It changes motion intensity only, never the drawing.
The default demo: a deploy panel in a hosting dashboard, driven by status. LIVE assembles from squares as the panel comes in. "Redeploy" switches the status to building: LIVE folds into squares and unfolds as BUILD, with the elapsed build time under it. When the build is done the squares rearrange into LIVE. "Pause" does the same with PAUSED.
preset="mosaic" on the join card of a meeting room. The code is drawn in tinted pieces; pointing at it, or focusing the button around it, folds every character into its square. A click hands the squares along the row, and the button copies the code to the clipboard.
preset="seams" for the active workspace, so pointing at it parts and lifts the pieces without folding the word. The archived workspace is read-only: its word has interactive={false} and stays still under the pointer.
Charge. Hover, focus or a tap opens the cuts between the seven pieces of each letter and lifts the letter slightly on its flat shadow plate.
Action. Letter by letter, from the first to the last, the pieces fly into the canonical tangram square. Each piece turns (never more than half a turn) and reshapes into its role in the square. Every frame in flight shows whole, flat pieces.
Settle. The overshoot of the fold spring is drawn as a squash of the letter on its plate. Leaving, the squares fold back into the word the same way, letter by letter.
On the first view the word starts as squares, holds for a moment and assembles into the word once. intro={false} keeps the word as it is. With a mouse, a click adds a short hand-off along the squares.
The text is real. A screen-reader-only copy holds the word and the drawing is aria-hidden and not focusable, so the word is announced once, as written. The drawing is not selectable.
The drawing never carries information that the text does not. With status, the screen-reader copy is a polite live region (role="status"): the new status is announced as soon as it changes, before the drawing finishes. The demo also writes the build progress in text under the word.
Letters use foreground by default. In mosaic, and in the squares, every piece measured at least 3:1 against the page background in the site, rose and green themes, in light and dark.
The word itself is not focusable. Place it inside a link or button to make it interactive for the keyboard.
The component has no key handling of its own. When it sits inside a link, button, summary, label or an element with tabindex, focus on that element folds the word and losing focus unfolds it.
Key
Result
Tab
Moves focus to the surrounding control; the word folds while it has focus.
With reduced motion the word never flies. Hover, focus and tap do not animate, and nothing else moves: the word is drawn as the letters at rest with slightly wider cuts. The controlled active still works: it switches between the word and the squares in place, with no animation. A new status or word replaces the old one in place. Nothing disappears.
One requestAnimationFrame loop, started by a hover, focus, tap or intro and stopped as soon as every letter has settled. Pieces are drawn as SVG paths from a spring per letter; no filters, no canvas.
When the word leaves the viewport or the tab is hidden, the loop stops and every letter jumps to its target state, so the word is finished when it comes back. The intro waits for the word to be in view and plays again if you scrolled away before it ran.
The SVG reserves the width of the widest pose, so the layout does not shift while the word folds. Seams stay in pixels at any scale, measured with a ResizeObserver.
The word is hidden until it is measured when the intro is on, so the server render never shows a misplaced frame. Touch devices have no hover: a tap toggles the squares, and a second tap folds them back.
interactive={false} removes hover, tap and click; the intro, active and status changes still play.
A status change that happens off screen or in a hidden tab swaps the word at once, without motion.
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 6.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom.
Dependencies
motion
Triggers
pointer movement, keyboard focus, press, entering the viewport, a value change
Reduced motion
The word composed with its cuts visible at 1.5 px; hover, tap, click and intro do nothing, a controlled active state switches in place and a new status replaces the word in place (still announced).
Keyboard
Tab
Focus on the link or button around the word folds it into tangram squares; leaving focus lands it back
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)