---
title: "Text Pinch Warp"
description: "A lens follows the pointer and pinches the letters under it smaller; a press sends a ring wave through the text."
url: https://gelatinui.com/components/text-pinch-warp
markdown_url: https://gelatinui.com/components/text-pinch-warp.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-pinch-warp"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Pinch Warp

> A lens follows the pointer and pinches the letters under it smaller; a press sends a ring wave through the text.

Page: https://gelatinui.com/components/text-pinch-warp

## When to use it

Best for: One short display heading that the pointer can explore; it is still until the pointer comes.

- Wrap the text of a heading. At rest the canvas shows the same text at the same place, so the swap does not show.
- Use `strength` (0 to 1, default 1) and `radius` (px, default 1.1 × the font size) for how much and how wide.
- Use `ripple={false}` for no ring wave on a press.
- Use `plain` to show the plain text, for example on a page with many effects.

## When not to use it

- For the same effect with another look, use [Text Bulge Warp](https://gelatinui.com/components/text-bulge-warp.md).
- For a heading made of particles that push away from the pointer, use [Text Particle](https://gelatinui.com/components/text-particle.md).
- For a heading drawn as monospace glyphs, use [Text ASCII](https://gelatinui.com/components/text-ascii.md).
- For a variable font that grows heavier near the pointer, with no WebGL, use [Text Variable Proximity](https://gelatinui.com/components/text-variable-proximity.md).
- For a long article or text people must read with no pointer, use plain text.

## Notes for agents

- Pinch Warp Text is Warp Text with `lens="pinch"` fixed: it takes every other Warp Text prop and part.
- `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.
- Nothing moves by itself: with no pointer, no finger, and no focus, it draws no frame. So it has no `paused` or `loop` prop.
- The canvas is 0.5em taller above and below the text, so a letter that the lens grows past the line is not cut; never wider, so a full-width heading does not scroll sideways.
- 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, so a long page stays under the browser cap of about 16 live contexts. A hidden tab draws nothing.
- On a touch screen the lens follows a finger and goes when it lifts, and the page still scrolls up and down (`touch-action: pan-y`).

## Anatomy

```text
TextPinchWarp
```

## API reference

### TextPinchWarp

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  | The text. |
| `strength` | `number` |  | How strong the lens is, from 0 to 1. Default 1. |
| `radius` | `number` |  | The lens radius in px. Default: 1.1 × the font size. |
| `ripple` | `boolean` |  | A press sends a ring wave through the text. Default true. |
| `plain` | `boolean` |  | 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 |
| --- | --- | --- | --- | --- |
| TextPinchWarp | `text-pinch-warp` |  |  |  |

## Usage

Wrap the text of a heading. Pick the `lens` that fits the product.

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-pinch-warp @gelatin-ui/badge @gelatin-ui/button
```

```tsx title="camera-hero.tsx"
import { TextPinchWarp } from "@/components/pro/text/text-pinch-warp";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";

export function CameraHero() {
  return (
    <section className="flex max-w-3xl flex-col items-start gap-4 py-24">
      <Badge variant="secondary">Camera 2</Badge>
      <h1 className="text-7xl font-black tracking-tight sm:text-8xl">
        <TextPinchWarp strength={0.8}>
          Clarity
        </TextPinchWarp>
      </h1>
      <p className="max-w-md text-muted-foreground">
        A lens that sees in the dark. Move over the name to look through it.
      </p>
      <div className="flex gap-2">
        <Button>Pre-order</Button>
        <Button variant="outline">See the specs</Button>
      </div>
    </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-pinch-warp
```

It adds 37 registry items: 37 files, 5780 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 Bulge Warp](https://gelatinui.com/components/text-bulge-warp.md)
- [Text Swirl Warp](https://gelatinui.com/components/text-swirl-warp.md)
- [Text Particle](https://gelatinui.com/components/text-particle.md)
- [Text ASCII](https://gelatinui.com/components/text-ascii.md)
- [Text Variable Proximity](https://gelatinui.com/components/text-variable-proximity.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Keyboard focus on the link or button around the text runs the lens once along the line. |

## Motion

| Part | Motion |
| --- | --- |
| Lens | cursorFollow · the lens follows the pointer on a spring and fades in as it comes onto the text; its edge falls off on a smoothstep |
| Ring | press · 1s · a ring wave goes out from the press point across about two lens sizes and fades |
| Sweep | glide · 1.2s · keyboard focus runs the lens once along the line |
