---
title: "Text Constellation"
description: "Stars sit on the letter outlines and lines join them like a star chart. The stars twinkle and lean to the pointer."
url: https://gelatinui.com/components/text-constellation
markdown_url: https://gelatinui.com/components/text-constellation.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-constellation"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Constellation

> Stars sit on the letter outlines and lines join them like a star chart. The stars twinkle and lean to the pointer.

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

## When to use it

Best for: A short, large headline or name that should feel like a night sky and still read clearly.

- Use it on display text, 32px and up: under 24px the stars sit close and the text stays at 40% under them.
- Use `trigger="hover"` inside a link or button: it reads the hover and focus of the nearest one, and goes back to the text after.
- Set `drawn` to draw the chart or take it back from app state.

## When not to use it

- For a label that rolls on hover, use [Text Roll](https://gelatinui.com/components/text-roll.md).

## Notes for agents

- `children` is a string, or the parts `TextConstellationContent` and `TextConstellationCanvas`. Leave out the canvas part for plain text.
- The real text stays in the page: wrap, selection, and the accessible name do not change. The canvas is `aria-hidden`.
- The stars and lines take the text color. Text with a see-through fill (a gradient clip) stays plain.
- The loop stops off screen and in a hidden tab. With no 2D canvas, the text shows plain.

## Anatomy

```text
TextConstellation
├─ TextConstellationContent (0..n)
└─ TextConstellationCanvas (0..n)
```

## API reference

### TextConstellation

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | A string, or the parts `TextConstellationContent` and `TextConstellationCanvas`. |
| `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"`. |
| `trigger` | `"hover" \| "mount" \| "view"` | "view" | When the lines draw: `view` (default) once, the first time it shows; `mount` once, at once; `hover` while a pointer is over it or keyboard focus is on it (or the link around it), and back to the plain text when it leaves. |
| `drawn` | `boolean` |  | True draws the chart, false goes back to the plain text, on top of the trigger. |
| `onDrawn` | `function` |  | Called when the lines finish and the chart rests. |

### TextConstellationContent

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

### TextConstellationCanvas

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

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextConstellation | `text-constellation` |  |  |  |
| TextConstellationContent | `text-constellation-content` |  |  |  |
| TextConstellationCanvas | `text-constellation-canvas` |  |  |  |

## Usage

Wrap the headline. It draws once when it scrolls into view.

```tsx title="hero.tsx"
import {
  TextConstellation,
  TextConstellationCanvas,
  TextConstellationContent,
} from "@/components/pro/text/text-constellation";

export function Hero() {
  return (
    <section className="flex flex-col items-center gap-4 py-24 text-center">
      <h1 className="text-6xl font-semibold tracking-tight">
        <TextConstellation trigger="view">
          <TextConstellationContent>Components that light up the page</TextConstellationContent>
          <TextConstellationCanvas />
        </TextConstellation>
      </h1>
      <p className="text-muted-foreground">Copy the source, keep the craft.</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-constellation
```

It adds 35 registry items: 35 files, 4796 lines, and the npm packages `@mantine/hooks`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `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 Roll](https://gelatinui.com/components/text-roll.md)
- [Text Liquid](https://gelatinui.com/components/text-liquid.md)

## Motion

| Part | Motion |
| --- | --- |
| Draw | draw · 0.9s per outline on the panel curve · letters start 60ms apart, 1.2s at most · each star pops in over 0.4s |
| Twinkle | sine · Each star swings between 62% and 100% at 0.18 to 0.5 Hz · never off, never faster than a flash every 2s |
| Pointer | follow · Stars within 1.4em brighten and lean up to 0.08em toward the pointer · eases in and out over about 0.25s |
