Skip to content

Text Shatter

Pro

A press cracks the text into glass shards that fly, fall, and bounce, then come back together into letters.

  • React 19
  • Tailwind CSS 4

Added Nov 15, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Text Shatter needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
35
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Wrap the word people can break. It is a button for the keyboard, inside the heading.

The sample also uses Button. One command adds them with this item:

landing-hero.tsx

TextShatter

<span>
PropTypeDefaultDescription
childrenReactNode—A string, or the parts TextShatterContent and TextShatterCanvas.
onError—Called when Matter.js does not load (the text then stays plain).
localestring—The BCP 47 locale of the text, for the letter split and the case of text-transform on the canvas. Default: the DisplayLocaleProvider locale, else "en-US".
trigger"click""hover""mount""view""click"What shatters it: click (default) a click or tap, or Enter or Space when it has focus; view once, the first time it shows; mount once, at once; hover each time a pointer or keyboard focus reaches it (or the link around it).
shatterboolean—True shatters it and holds the shards apart until false; then they come home.
onSettled—Called when every letter is home and the page text shows again.
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

TextShatterContent

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

TextShatterCanvas

<canvas>
PropTypeDefaultDescription
...props<canvas> attributes—Every other attribute goes to the <canvas>, with a ref.
  • Use it on display text, 20px and up. Each letter cracks into 3 shards at 20px and 6 from 56px.
  • Use trigger for what breaks it: click (default), view or mount once, or hover.
  • Set shatter to hold the shards apart from app state; false brings them home.
TabMoves the focus to the text, with trigger="click".
EnterorSpaceShatters the text. In flight, it throws the shards again.
Crack
press · 100ms · each shard moves out 0.03em, so hairline cracks show
Flight
drift · 0.9s · the shards burst out and up, tumble, and bounce on Matter.js physics at 120 steps a second
Return
drift · spring · 476ms · each shard glides home at 15px per frame at most, and each letter locks whole
  1. AddedText Shatter.
Open the release