---
title: "Text Ferrofluid"
description: "The letters are black magnetic liquid that grows spikes toward the pointer and settles back when it leaves."
url: https://gelatinui.com/components/text-ferrofluid
markdown_url: https://gelatinui.com/components/text-ferrofluid.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-ferrofluid"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Ferrofluid

> The letters are black magnetic liquid that grows spikes toward the pointer and settles back when it leaves.

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

## When to use it

Best for: A short, bold heading of black liquid that grows spikes toward the pointer.

- Use one bold word: the spikes need thick strokes.
- Put it on a light or dark page: the liquid stays black.

## When not to use it

- For text that drips like wet ink, use [Text Liquid](https://gelatinui.com/components/text-liquid.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
TextFerrofluid
├─ TextFerrofluidContent (0..n)
└─ TextFerrofluidCanvas (0..n)
```

## API reference

### TextFerrofluid

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | A string, or the parts `TextFerrofluidContent` and `TextFerrofluidCanvas`. |
| `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"`. |

### TextFerrofluidContent

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

### TextFerrofluidCanvas

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

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextFerrofluid | `text-ferrofluid` |  |  |  |
| TextFerrofluidContent | `text-ferrofluid-content` | `data-covered` |  |  |
| TextFerrofluidCanvas | `text-ferrofluid-canvas` | `data-covered` |  |  |

## Usage

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

```tsx title="magnetic-heading.tsx"
import { TextFerrofluid, TextFerrofluidCanvas, TextFerrofluidContent } from "@/components/pro/text/text-ferrofluid";

export function MagneticHeading() {
  return (
    <section className="flex flex-col items-center gap-4 py-16 text-center">
      <h1 className="text-8xl font-black tracking-tight">
        <TextFerrofluid>
          <TextFerrofluidContent>Magnetic</TextFerrofluidContent>
          <TextFerrofluidCanvas />
        </TextFerrofluid>
      </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-ferrofluid
```

It adds 36 registry items: 36 files, 5791 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 Liquid](https://gelatinui.com/components/text-liquid.md)
- [Text Variable Proximity](https://gelatinui.com/components/text-variable-proximity.md)
- [Text Particle](https://gelatinui.com/components/text-particle.md)
