---
title: "Text Cloth"
description: "The text is printed on a sheet of cloth that ripples and folds where the pointer moves."
url: https://gelatinui.com/components/text-cloth
markdown_url: https://gelatinui.com/components/text-cloth.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-cloth"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Cloth

> The text is printed on a sheet of cloth that ripples and folds where the pointer moves.

Page: https://gelatinui.com/components/text-cloth

## When to use it

Best for: A short heading printed on cloth that ripples under the pointer.

- Use `trigger="hover"` to start only when the pointer is on it.
- Keep it to one or two words: the cloth is one mesh.

## When not to use it

- For text on a shiny waving ribbon, use [Text Ribbon](https://gelatinui.com/components/text-ribbon.md).
- For text that folds like paper, use [Text Fold](https://gelatinui.com/components/text-fold.md).

## Notes for agents

- It draws with WebGL. With no WebGL, the plain text shows.
- Write the text in the Content part and put the Canvas part after it.

## Anatomy

```text
TextCloth
├─ TextClothContent (0..n)
└─ TextClothCanvas (0..n)
```

## API reference

### TextCloth

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | A string, or the parts `TextClothContent` and `TextClothCanvas`. |
| `locale` | `string` |  | The BCP 47 locale of the text, for the case of `text-transform` on the cloth. Default: the `DisplayLocaleProvider` locale, else `"en-US"`. |
| `trigger` | `"hover" \| "view"` | "view" | `view` (default): a gust ripples the cloth once, the first time it shows. `hover`: it only moves under the pointer. Both ripple under the pointer, and keyboard focus on the link around it sends a gust. |

### TextClothContent

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

### TextClothCanvas

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

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextCloth | `text-cloth` |  |  |  |
| TextClothContent | `text-cloth-content` | `data-rippling` |  |  |
| TextClothCanvas | `text-cloth-canvas` | `data-rippling` |  |  |

## Usage

Put the heading in the Content part and the Canvas after it.

```tsx title="goods-heading.tsx"
import { TextCloth, TextClothCanvas, TextClothContent } from "@/components/pro/text/text-cloth";

export function GoodsHeading() {
  return (
    <section className="flex flex-col items-center gap-4 py-16 text-center">
      <h1 className="text-7xl font-bold tracking-tight">
        <TextCloth>
          <TextClothContent>Soft goods</TextClothContent>
          <TextClothCanvas />
        </TextCloth>
      </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-cloth
```

It adds 38 registry items: 38 files, 5229 lines, and the npm packages `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`.

## 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

- [Text Ribbon](https://gelatinui.com/components/text-ribbon.md)
- [Text Fold](https://gelatinui.com/components/text-fold.md)
