motion-liquid
Applies an animated SVG displacement filter to text, giving it a living, fluid quality. It feels like ink in water or hot air shimmer. No WebGL required.
Preview
Import
import 'motion-components/motion-liquid' // just this one
import 'motion-components' // or the whole libraryUsage
Static content
Write the text as a child. The browser shows it as plain text before the element is defined, so the page never paints an empty gap while the library loads.
<motion-liquid intensity="12" duration="4.5">LIQUID</motion-liquid>Dynamic content
Use the text attribute when text changes at runtime. Setting the property restarts the animation automatically.
const el = document.querySelector('motion-liquid')
el.text = 'UPDATED' // animation restartsIf both are present, the attribute wins and the child text stays as the pre-upgrade fallback.
Intensity
<motion-liquid intensity="5">SUBTLE</motion-liquid>
<motion-liquid intensity="24">INTENSE</motion-liquid>Duration
<motion-liquid intensity="14" duration="18">SLOW</motion-liquid>
<motion-liquid intensity="14" duration="2.25">FAST</motion-liquid>Pause on hover
Add
<motion-liquid intensity="14" duration="6" pause-on-hover>
HOVER ME
</motion-liquid>How it works
An SVG
Properties
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
| | | string | — | Text to render with the liquid effect. Falls back to the child text when unset |
| | | number | 10 | Maximum displacement in px |
| | | number | 4.5 | Seconds per distortion cycle. Lower is faster, |
| | | boolean | false | Freeze motion on mouseenter, resume on mouseleave |
JavaScript API
Control the liquid programmatically with play(), pause(), finish(), and cancel().
Accessibility
When