---
title: "Text Mosaic"
description: "The letters are made of many small photos that shuffle and sort into place."
url: https://gelatinui.com/components/text-mosaic
markdown_url: https://gelatinui.com/components/text-mosaic.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-mosaic"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Mosaic

> The letters are made of many small photos that shuffle and sort into place.

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

## When to use it

Best for: A large, bold heading built from many small photos that sort into place.

- Pass 12 or more square photos in `photos`.
- Use `trigger="hover"` to build on the pointer.

## When not to use it

- For a heading built from blocks, use [Text Block Build](https://gelatinui.com/components/text-block-build.md).
- For a heading from particles, use [Text Particle](https://gelatinui.com/components/text-particle.md).

## Notes for agents

- Host the photos on the same origin, or send CORS headers: the canvas reads them.
- Write the text in the Content part and put the Canvas part after it.

## Anatomy

```text
TextMosaic
├─ TextMosaicContent (0..n)
└─ TextMosaicCanvas (0..n)
```

## API reference

### TextMosaic

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | A string, or the parts `TextMosaicContent` and `TextMosaicCanvas`. |
| `photos` | `readonly string[]` |  | The photo URLs the tiles show, in any number (8 to 16 read best). The item ships no photos: pass your own. A photo that fails to load is left out; with none the text stays plain. |
| `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 tiles sort in: `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. |
| `built` | `boolean` |  | True builds the mosaic, false goes back to the plain text, on top of the trigger. |
| `onSettled` | `function` |  | Called when the tiles rest in the letters, or the text is plain again. |

### TextMosaicContent

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

### TextMosaicCanvas

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

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextMosaic | `text-mosaic` |  |  |  |
| TextMosaicContent | `text-mosaic-content` | `data-covered` |  |  |
| TextMosaicCanvas | `text-mosaic-canvas` |  |  |  |

## Usage

Give the photos, then the word in the Content part.

```tsx title="team-heading.tsx"
import { TextMosaic, TextMosaicCanvas, TextMosaicContent } from "@/components/pro/text/text-mosaic";

const PHOTOS = ["/team/ana.webp", "/team/ben.webp", "/team/chen.webp", "/team/dara.webp"];

export function TeamHeading() {
  return (
    <section className="flex flex-col items-center gap-4 py-16 text-center">
      <h1 className="text-8xl font-black tracking-tight">
        <TextMosaic photos={PHOTOS}>
          <TextMosaicContent>Our team</TextMosaicContent>
          <TextMosaicCanvas />
        </TextMosaic>
      </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-mosaic
```

It adds 34 registry items: 34 files, 4715 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 Block Build](https://gelatinui.com/components/text-block-build.md)
- [Text Particle](https://gelatinui.com/components/text-particle.md)
- [Text Media](https://gelatinui.com/components/text-media.md)
