Account

Typography

Creative

Masked Text

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.

Install

Included with Creative: needs your API key. Initialize and log in once.

Terminal
npx @galactrex/ui add masked-text

Usage

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

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

Source

Installs to components/galactrex/masked-text.tsx, with the shared motion primitives beside it.

Source for this component comes with its plan. Install it with the command above, or open your licensed copy here.

See plans

Props

PropTypeDefaultDescription
textstring—The text.
asElementType"h2"Element.
srcstring—Image seen through the letters.
durationnumber18Seconds for one drift.
classNamestring—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 and reduced motion

  • Background position only.
  • Reduced motion: still.