Angular adaptation of an effect by David Haz / reactbits.dev.
Import
import { WrFallingText } from 'ngwr/falling-text';Playground
Hover this block. Each word falls and you can drag them around.
<wr-falling-text
text="Hover this block. Each word falls and you can drag them around."
trigger="hover"
[gravity]="980"
fontSize="1.5rem"
/>Customize
Trigger
Gravity 980
Font Size
Text
API
| Name | Description | Type | Default |
|---|---|---|---|
textrequired | Text to render. Words are separated by spaces. | string | — (required) |
highlightWords | Prefix-match keywords. Matching words get the wr-falling-text__word--hl class. | readonly string[] | [] |
trigger | When to release the words into the simulator. | 'auto' | 'scroll' | 'hover' | 'click' | 'auto' |
gravity | Gravity in pixels/sec². | number | 980 |
fontSize | Font size as a CSS length. | string | '1rem' |