---
title: "Text Ribbon"
description: "The text is printed on a ribbon that twists in 3D, with a wave along it and a turn toward the pointer."
url: https://gelatinui.com/components/text-ribbon
markdown_url: https://gelatinui.com/components/text-ribbon.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-ribbon"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Ribbon

> The text is printed on a ribbon that twists in 3D, with a wave along it and a turn toward the pointer.

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

## When to use it

Best for: One short display line, 40px and up, on a launch or release page.

- Use `wave="once"` (default) for one wave on view and on each press, `loop` for a wave all the time.
- Use `turn` (0 to 1) for how far the pointer turns the band.
- Use `bloom` and `grain` for the glow and the film grain; 0 turns each off and skips its pass.
- Set `font` to the URL of the text's font file (woff, ttf, or otf; not woff2, which troika cannot read) for SDF glyphs that stay sharp when the band turns far.
- Set `--ribbon-text-face`, `--ribbon-text-ink`, and `--ribbon-text-back` on the root for other colors.

## When not to use it

- For a title that folds in 3D with CSS only, use [Text Fold](https://gelatinui.com/components/text-fold.md).

## Notes for agents

- `children` is a string, or the parts `TextRibbonContent` and `TextRibbonCanvas`.
- The real text stays in the page: size, wrap, selection, and the name do not change. The canvas is `aria-hidden`.
- three.js loads when the text comes near the screen, postprocessing only with a glow or grain, troika only with a `font`.
- Keyboard: `TextRibbonControl` shows on focus; Enter or Space sends one wave, whatever `wave` is (unless it loops).
- No WebGL, or a failed load: the plain text shows and `onError` gets the error.
- Without `font` the band shows the page text as the browser draws it; troika needs a font file URL and never reads a CSS font.

## Anatomy

```text
TextRibbon
├─ TextRibbonContent (0..n)
├─ TextRibbonCanvas (0..n)
└─ TextRibbonControl (0..n)
```

## API reference

### TextRibbon

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | A string, or the parts `TextRibbonContent`, `TextRibbonCanvas`, and `TextRibbonControl`. |
| `wave` | `"loop" \| "none" \| "once"` | "once" | The wave along the band: `once` (default) when it first shows and on each press, `loop` all the time, `none` never (the pointer still turns it). |
| `turn` | `number` | 0.6 | How far the band turns under the pointer, 0 (not at all) to 1 (a half turn). Default 0.6. |
| `bloom` | `number` | 0.6 | The glow around the band, 0 (off) to 2. Default 0.6. |
| `grain` | `number` | 0.35 | The film grain on the band, 0 (off) to 1. Default 0.35. |
| `font` | `string` |  | A font file URL of the text's font, woff, ttf, or otf (not woff2: troika cannot read it): the glyphs are drawn as SDF and stay sharp when the band turns. Default: the page text, drawn as the browser lays it out. |
| `paused` | `boolean` | false | Stops the wave where it is; the band eases flat. |
| `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. |
| `labels` | `Partial<{ wave: string; }>` |  | The words of the control (`RIBBON_TEXT_LABELS`). Keep the object stable. |

### TextRibbonContent

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

### TextRibbonCanvas

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

### TextRibbonControl

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `visible` | `boolean` | false | The control shows at all times. Default: only on keyboard focus. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextRibbon | `text-ribbon` |  |  |  |
| TextRibbonContent | `text-ribbon-content` |  |  |  |
| TextRibbonCanvas | `text-ribbon-canvas` |  |  |  |
| TextRibbonControl | `text-ribbon-control` |  |  |  |

## Usage

Wrap the line of a release hero. The root padding is the band margin.

```tsx title="release-hero.tsx"
import {
  TextRibbon,
  TextRibbonCanvas,
  TextRibbonContent,
  TextRibbonControl,
} from "@/components/pro/text/text-ribbon";

export function ReleaseHero() {
  return (
    <section className="flex flex-col items-center gap-4 py-24 text-center">
      <p className="text-sm text-muted-foreground">Release 2.0 · November</p>
      <h1 className="text-7xl font-bold tracking-tight">
        <TextRibbon wave="once" bloom={0.6} grain={0.35}>
          <TextRibbonContent>Ship it fast</TextRibbonContent>
          <TextRibbonCanvas />
          <TextRibbonControl />
        </TextRibbon>
      </h1>
    </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-ribbon
```

It adds 49 registry items: 46 files, 7878 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@xstate/react`, `clsx`, `motion`, `postprocessing`, `tailwind-merge`, `tailwind-variants`, `three`, `troika-three-text`, `xstate`.

## Built on

- [Button](https://gelatinui.com/components/button.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

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

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves focus to the control on the end of the band. It shows only while it has keyboard focus, unless `visible` is set. |
| Enter, Space | Sends one wave along the band. |

## Motion

| Part | Motion |
| --- | --- |
| Wave | sine · 1.6s ease in, held, eased out by 5s · the band twists up to 66° along 1.2 waves |
| Pointer | indicator · in, panel out · the band turns up to a half turn under the pointer |
