Gravity Text Swap
Web (React)
Text that detaches and falls away with simulated gravity when swapped.
A physics-based typography component. The old characters physically drop out of the layout with staggered gravity logic, allowing the new characters to spring into place from above.
Let'sDesignfaster.
Installation
CLI
npx @modus-ui/cli add gravity-text-swapManual
- Copy the code from the component tab.
- Create a file at
components/ui/gravity-text-swap.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
texts | string[] | - | The strings to cycle through. |
duration | number | 0.5 | Seconds each swap animation takes. |
pauseDuration | number | 2 | Seconds each string stays visible. |
Comments