---
title: "Text Particle"
description: "Thousands of small particles gather into the letters, push away from the pointer, and spring back after a press."
url: https://gelatinui.com/components/text-particle
markdown_url: https://gelatinui.com/components/text-particle.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-particle"
version: "2026-11-14"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Particle

> Thousands of small particles gather into the letters, push away from the pointer, and spring back after a press.

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

## When to use it

Best for: One short, large, heavy display heading: a brand or product name of 60px or more.

- Wrap the text of a heading. Large, heavy text reads best: each letter is a field of particles.
- Use `gap` for the space between particles. The default is the font size / 28, from 2 to 8px; `particleSize` defaults to 90% of the gap.
- Use `repel={false}` for no push from the pointer, and `burst={false}` for no throw on a press.
- Use `loop` to keep the slow drift going, and `paused` to stop it from a control of the page.
- Use `plain` to show the plain text, for example on a page with many effects.

## When not to use it

- For a heading drawn as monospace glyphs, with a terminal look, use [Text ASCII](https://gelatinui.com/components/text-ascii.md).
- For body text, small text, or a long paragraph, use plain text: a few particles per letter do not read.

## Notes for agents

- `children` must be a string. The real text stays in the line: it sets the size and the wrap, a screen reader reads it once, and the visitor can select it. The canvas on it is `aria-hidden` and takes no pointer.
- The canvas is 0.5em taller above and below the text for the press spring, never wider, so a full-width heading does not scroll sideways. Particles that fly past a side are cut there.
- Each particle takes the color of the text where it sits, so a colored word stays colored; pushed particles turn toward `--primary`. A theme change redraws them.
- Three.js loads on demand the first time the text comes near the screen. Until the first frame draws, the text is see-through; when no frame draws in 3s, the plain text shows.
- With no WebGL 2, or when the setup fails, the plain text stays and `onError` gets the error. An empty text makes no WebGL context.
- A text off screen for 3s gives its WebGL context back and makes a new one when it comes near again. A hidden tab draws nothing. At most 20,000 particles: a longer text gets a larger gap.
- The intro and the drift stop by themselves after 5 seconds unless `loop` is true. `paused` (with `defaultPaused` and `onPausedChange`) stops them; the pointer still pushes. There is no hover hold: the pointer is the effect.
- On a touch screen a finger pushes where it is, and the page still scrolls up and down (`touch-action: pan-y`).

## Anatomy

```text
TextParticle
```

## API reference

### TextParticle

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `paused` | `boolean` |  | The pause of the user or the page (controlled). |
| `defaultPaused` | `boolean` |  | The first pause when `paused` is not given (uncontrolled). Default false. |
| `onPausedChange` | `function` |  | Called when the pause changes. |
| `children` | `string` |  | The text. Large, heavy display text reads best: each letter is a field of particles. |
| `gap` | `number` |  | The space between particles in px. Default: the font size / 28, from 2 to 8px. |
| `particleSize` | `number` |  | The particle size in px. Default: 90% of the gap. |
| `intro` | `boolean` | true | Gather the particles into the text the first time it shows. Default true. |
| `loop` | `boolean` | false | Keep the slow drift going. Default false: the drift stops after 5 seconds, so the GPU rests. `paused` stops a looping drift. |
| `repel` | `boolean` | true | Push the particles away from the pointer. Default true. |
| `burst` | `boolean` | true | A press throws the particles out from the press point, and they spring back. Default true. |
| `plain` | `boolean` | false | Show the plain text, with no WebGL. |
| `onError` | `function` |  | Called when three.js does not load or the WebGL setup fails. The plain text stays. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextParticle | `text-particle` |  |  |  |

## Usage

Wrap the brand or product name of a heading. Keep the rest of the page plain.

The sample also uses `badge`, `button`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui-pro/text-particle @gelatin-ui/badge @gelatin-ui/button
```

```tsx title="beta-hero.tsx"
import { ArrowRightIcon } from "@phosphor-icons/react/ssr";

import { TextParticle } from "@/components/pro/text/text-particle";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";

export function BetaHero() {
  return (
    <section className="flex max-w-3xl flex-col items-start gap-4 py-24">
      <Badge variant="secondary">Now in beta</Badge>
      <h1 className="text-7xl font-black tracking-tight sm:text-8xl">
        <TextParticle>Nebula</TextParticle>
      </h1>
      <p className="max-w-md text-muted-foreground">
        The data platform that grows with your team.
      </p>
      <Button>
        Join the beta
        <ArrowRightIcon data-icon="inline-end" />
      </Button>
    </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-particle
```

It adds 40 registry items: 40 files, 6613 lines, and the npm packages `@mantine/hooks`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `three`, `xstate`.

## 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 ASCII](https://gelatinui.com/components/text-ascii.md)
- [Text Sparkles](https://gelatinui.com/components/text-sparkles.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Keyboard focus on the link or button around the text sweeps the push once along the line; with `repel={false}` it throws the particles from the center. |

## Motion

| Part | Motion |
| --- | --- |
| Intro | reveal · 1.6s · each particle waits up to 40% of it, then flies into its letter on a cubic ease out |
| Push | cursorFollow · particles within 1.2 × the font size move away from the pointer and come back; the pointer place follows on a spring |
| Burst | elastic · 1.6s · a press throws the particles out from the press point, and they settle on a damped spring |
| Drift | drift · each particle moves a little on a slow sine, which eases out by 5s unless `loop` is true |
