Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Text

Pro

Liquid Text for React

Text that behaves like a liquid, its letters swaying and melting into each other where they touch. For React with Base UI, when a headline should look alive.

Framework

Liquid Text makes a line behave like liquid: every letter sways on its own, two slow swells out of step, and where neighbours come close they melt into one blob and pull apart again, like droplets on glass. While the pointer is over it the letters sway further and run into each other.

Use it for a hero word or a short title in a heavy weight, at a large size. For letters that rise and fall on a wave without merging, use Wave Text; for a pointer that bends the text, Elastic Text. Each letter's sway is two CSS keyframe animations, added to your stylesheet by the install and phased by the letter's place, so it never quite repeats; an SVG goo filter (a blur, then a sharp cut of its edge) merges the letters that touch. With reduced motion the letters hold still.

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Usage

import { LiquidText } from "@/components/ui/liquid-text";
<h1 className="font-black text-6xl">
  <LiquidText text="Liquid" />
</h1>

Demos

Intensity

intensity is how far the letters sway: subtle, medium or strong. Hovering eases any of them out to nearly twice as far.

Preview width

Blur

blur is how far apart letters can be and still melt together, in pixels, 2 by default. More makes thick gel; on smaller text use less, about a twentieth of the font size, or the holes in letters such as e and a fill in.

Preview width

Accessibility

Screen readers read the text once, from a visually hidden copy; the swaying letters are hidden from them. The goo rounds letters off, so keep it to large, heavy text, a headline of 36 px and up, and check it still reads. With reduced motion the letters hold still, and in forced-colors mode the filter is dropped.

FAQ

How do the letters melt together?

An SVG filter blurs the letters, then cuts the blur's edge sharp at half strength: alone, a letter keeps its shape with rounded corners; when two come close, their blurs overlap past half and the cut joins them in one blob.

What size and weight suit it?

Large and heavy: font-black from about text-4xl up. The blur is in pixels, so the same blur softens small text more; lower it for smaller sizes, and keep normal letter spacing so the letters have room to meet and part.

Does the motion loop visibly?

Hardly: each letter adds two swells of different lengths, 1.7 and 2.9 seconds, each started at a different point for every letter, so the pattern takes a long time to come round again.

Does it work in every browser?

SVG filters on HTML text work in current Chrome, Edge, Firefox and Safari. The filter redraws the text on every frame, which Safari does more slowly: keep it to one headline per page.

Can I use several on one page?

Yes. Each one names its filter with an id of its own, so instances never share or override each other's filter.

What happens with reduced motion?

The letters hold still, softly rounded by the filter, and don't sway on hover.

API Reference

LiquidText

<span> data-slot="liquid-text"

PropType
textstring

The text.

blur?number

How far apart letters can be and still melt together: the blur the goo is made from, in pixels. Keep it near a twentieth of the font size, or the holes in letters fill in.

Default
2
intensity?"subtle" | "medium" | "strong"

How far the letters sway; while the pointer is over the text they sway nearly twice as far and run into each other.

Type
"subtle" | "medium" | "strong"
Default
"medium"
render?ReactElement | ((props: object, state: object) => ReactElement)

Replace the host element or compose it with another component.

Type
ReactElement | ((props: object, state: object) => ReactElement)
className?string

Merged with the part's classes.

CSS variableType
--liquid-text-goostring
--liquid-text-swaystring

How far a letter sways (0.06em at medium).

  • Pro

    Wave Text

    Motion

    Letters on a wave, never merging

  • Pro

    Elastic Text

    Interactive

    Letters stretch as the pointer passes

  • Pro

    Ripple Text

    Interactive

    A ripple from wherever you click

  • Pro

    Letters floating apart on their own

  • Pro

    Jelly letters that rock in place

  • Breathe in, breathe out

    Pro

    The whole line breathing as one

All 97 text effects