Shatter Text
SHATTER
Customize
Props
| Property | Type | Default | Description |
|---|---|---|---|
text | string | "SHATTER PHYSICS" | Display text to animate. |
trigger | string | "hover" | What starts the shatter, "hover" or "click". |
disabled | boolean | false | Disables the shatter interaction entirely. |
minY | number | 30 | Minimum vertical drop distance in pixels. |
maxY | number | 55 | Maximum vertical drop distance in pixels. |
minX | number | -15 | Minimum horizontal drift in pixels. |
maxX | number | 15 | Maximum horizontal drift in pixels. |
minRotation | number | -90 | Minimum rotation in degrees while falling apart. |
maxRotation | number | 90 | Maximum rotation in degrees while falling apart. |
fallDuration | number | 0.35 | Duration (s) of the fall-apart phase per character. |
reassembleDuration | number | 0.6 | Duration (s) of the reassemble phase per character. |
fallEase | string | "power2.in" | GSAP ease used while characters fall apart. |
reassembleEase | string | "bounce.out" | GSAP ease used while characters bounce back into place. |
stagger | number | 0.012 | Delay (s) between each character starting its fall. |
reassembleGap | number | 0.05 | Pause (s) between the fall finishing and reassembly starting. |
shatterOpacity | number | 0.3 | Opacity of each character at the moment of shatter, 0-1. |
shatterColor | string | "#ff2d78" | Color characters flash to while shattered. |
resetColor | string | "currentColor" | Color characters return to once reassembled. |
textClassName | string | "text-4xl md:text-5xl font-bold text-white" | Classes controlling font size, weight, and color. |
className | string | "" | Extra classes applied to the root wrapper. |
textstringDisplay text to animate.
"SHATTER PHYSICS"triggerstringWhat starts the shatter, "hover" or "click".
"hover"disabledbooleanDisables the shatter interaction entirely.
falseminYnumberMinimum vertical drop distance in pixels.
30maxYnumberMaximum vertical drop distance in pixels.
55minXnumberMinimum horizontal drift in pixels.
-15maxXnumberMaximum horizontal drift in pixels.
15minRotationnumberMinimum rotation in degrees while falling apart.
-90maxRotationnumberMaximum rotation in degrees while falling apart.
90fallDurationnumberDuration (s) of the fall-apart phase per character.
0.35reassembleDurationnumberDuration (s) of the reassemble phase per character.
0.6fallEasestringGSAP ease used while characters fall apart.
"power2.in"reassembleEasestringGSAP ease used while characters bounce back into place.
"bounce.out"staggernumberDelay (s) between each character starting its fall.
0.012reassembleGapnumberPause (s) between the fall finishing and reassembly starting.
0.05shatterOpacitynumberOpacity of each character at the moment of shatter, 0-1.
0.3shatterColorstringColor characters flash to while shattered.
"#ff2d78"resetColorstringColor characters return to once reassembled.
"currentColor"textClassNamestringClasses controlling font size, weight, and color.
"text-4xl md:text-5xl font-bold text-white"classNamestringExtra classes applied to the root wrapper.
""Dependencies
Crafted withbyMohammad Tasin
