Swoosh Text
スウーシュテキスト
Text that stands proud of the page and drops flat when you point at it. It is five stacked text-shadow↗↗ layers at increasing distance, each a step further down a single grey ramp, which the eye reads as one extruded solid rather than five copies. The original ran a neon ramp; the shape of the effect is in the spacing, not the hue, so it survives the move to greys. Hovering animates the same five shadows to zero offset instead of to none, so they collapse smoothly rather than vanishing between two frames. Adapted from Kokonut UI↗↗ under the MIT licence.
Installation
Install the following dependencies:1
npm install framer-motionCopy and paste the following code into a new component file:2
How to use it3
Props
SwooshText
| Name | Default | Description |
|---|---|---|
| text | — | string The text to extrude |
| offset | 10 | number Pixels between the text and the first shadow |
| size | 30 | number Font size in pixels |
| dark | false | boolean Render the dark palette |