---
title: "Text Liquid Fill"
description: "Liquid fills the letters up to a level, so the text shows a percent, and the liquid sloshes as the page scrolls."
url: https://gelatinui.com/components/text-liquid-fill
markdown_url: https://gelatinui.com/components/text-liquid-fill.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-liquid-fill"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Liquid Fill

> Liquid fills the letters up to a level, so the text shows a percent, and the liquid sloshes as the page scrolls.

Page: https://gelatinui.com/components/text-liquid-fill

## When to use it

Best for: A large heading that fills with liquid to a percent value.

- Set `value` from 0 to 100.
- Use `slosh` to let the liquid move on scroll and change.

## When not to use it

- For a number that rolls to a new value, use [Rolling Number](https://gelatinui.com/components/rolling-number.md).
- For a heading that drips like ink, use [Text Liquid](https://gelatinui.com/components/text-liquid.md).

## Notes for agents

- Write the text in the Content part and put the Canvas part after it.
- The text keeps its own words: write the value in it if people must read it.

## Anatomy

```text
TextLiquidFill
├─ TextLiquidFillContent (0..n)
└─ TextLiquidFillCanvas (0..n)
```

## API reference

### TextLiquidFill

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `value` | `number` |  | How full the text is, 0 to 100. A change rises or falls with a wave. |
| `trigger` | `ViewEntryTrigger` | "view" | When it fills from empty: `view` (default) the first time it shows; `mount` at once. After it, each new `value` moves from the shown level. |
| `slosh` | `boolean` | true | True (default): the liquid sloshes with the page scroll speed. |
| `locale` | `string` |  | The BCP 47 locale of the text, for the case of `text-transform` on the canvas. Default: the `DisplayLocaleProvider` locale, else `"en-US"`. |
| `children` | `ReactNode` |  | A string, or the parts `TextLiquidFillContent` and `TextLiquidFillCanvas`. |

Also takes every prop of Base UI `Meter.Root`: https://base-ui.com/react/components/meter

### TextLiquidFillContent

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TextLiquidFillCanvas

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextLiquidFill | `text-liquid-fill` |  | `--liquid-fill-text-color` |  |
| TextLiquidFillContent | `text-liquid-fill-content` | `data-ready` |  |  |
| TextLiquidFillCanvas | `text-liquid-fill-canvas` |  |  |  |

## Usage

Set the value and write it in the text.

```tsx title="goal-heading.tsx"
import { TextLiquidFill, TextLiquidFillCanvas, TextLiquidFillContent } from "@/components/pro/text/text-liquid-fill";

export function GoalHeading() {
  return (
    <section className="flex flex-col items-center gap-4 py-16 text-center">
      <h1 className="text-7xl font-bold tracking-tight">
        <TextLiquidFill value={72}>
          <TextLiquidFillContent>72% funded</TextLiquidFillContent>
          <TextLiquidFillCanvas />
        </TextLiquidFill>
      </h1>
      <p className="text-muted-foreground">The heading stays real text for search and copy.</p>
    </section>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/text-liquid-fill
```

It adds 46 registry items: 42 files, 7101 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Meter](https://gelatinui.com/components/meter.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Rolling Number](https://gelatinui.com/components/rolling-number.md)
- [Text Liquid](https://gelatinui.com/components/text-liquid.md)
- [Text Particle](https://gelatinui.com/components/text-particle.md)
