# Masked Text

> Big letters as a window onto a moving image.

An image or a slow band of light drifts behind the type and is only seen through it. For hero words, campaign titles and posters.

- Family: Typography
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/masked-text/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add masked-text
```

It installs to `components/galactrex/masked-text.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

```tsx
import { MaskedText } from "@/components/galactrex/masked-text";

<MaskedText text="ORBIT" src="/nebula.jpg" className="text-9xl" />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `text` | `string` | — | The text. |
| `as` | `ElementType` | `"h2"` | Element. |
| `src` | `string` | — | Image seen through the letters. |
| `duration` | `number` | `18` | Seconds for one drift. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Light.** No image: a monochrome band of light.
- **Photo.** Pass `src`.

## Accessibility

- Real, selectable text; check contrast of your image against the page.

## Motion

- Background position only.
- Reduced motion: still.
