Light Text
Hollow lettering with a light behind it. Beams pour out through the letters, can reach toward your pointer, with a fine noise texture. Follows your theme.
Installation
pnpm dlx shadcn@latest add @breeze/light-textUsage
import { LightText } from "@/components/breeze/light-text"Give it a box; the lettering fits itself to the box's height and width.
<LightText text="BREEZE" className="h-[360px] w-full" />Use \n for more than one line:
<LightText text={"LIGHT\nLEAKS"} className="h-[480px] w-full" />Theme
By default the light is your --foreground colour on your --background, so it switches with the theme: bright beams pouring out of the dark in dark mode, and dark beams streaming across the page in light mode, like shadows through the letters. Pass color and background to fix them, for example a white light on black in both themes:
<LightText color="#ffffff" background="#060607" />Variants
solid: the letters glow and the beams pour out of them.outline: hollow letters. Only the outlines let light through, so the beams escape from the edges and corners.outlineWidthsets how thick they are.
The light
The light sits behind the text at lightX/lightY and wanders a little on its own (drift; 0 holds it still). The beams reach toward your pointer, easing after it, then settle back when it leaves. Pass followPointer={false} to keep the light still.
<LightText variant="outline" followPointer={false} lightY={0.2} />Under the hood, every pixel looks back toward the light and adds up whatever leaks through the letters, which is what makes the beams fan out. rayLength sets how far they reach, spread how wide they fan, and intensity how bright they are.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | "BREEZE" | The words; \n starts a new line |
variant | "solid" | "outline" | "solid" | Glowing letters, or hollow outlines |
color | string | "var(--foreground)" | Light colour, any CSS colour or var() |
background | string | "var(--background)" | Backdrop colour, or "transparent" |
intensity | number | 0.7 | Brightness of the beams |
rayLength | number | 0.21 | 0 to 1, how far the beams reach |
spread | number | 0.55 | How far the beams fan out |
noise | number | 0.07 | 0 to 1, a still noise texture over the whole image |
faceBrightness | number | 0.85 | 0 to 1, brightness of the letters themselves |
outlineWidth | number | 3 | Outline thickness in px (outline variant) |
weight | number | 900 | Font weight |
fontFamily | string | Geist | Any CSS font-family, var() works |
scale | number | 0.62 | Text height as a share of the box (it also fits the width) |
followPointer | boolean | true | The beams reach toward the pointer |
lightX | number | 0.5 | Resting light position across, 0 to 1 |
lightY | number | 0.5 | Resting light position down, 0 to 1 |
drift | number | 0.5 | How much the light wanders on its own |
The text uses Geist, a sharp grotesk, unless you pass fontFamily. The canvas has role="img" and the text as its label for screen readers. It pauses off-screen and in hidden tabs, and with reduced motion it renders a single still frame.