---
title: "Text Cast Shadow"
description: "Long shadows fall from the letters across the page, cast by the pointer as a light or by a set sun angle."
url: https://gelatinui.com/components/text-cast-shadow
markdown_url: https://gelatinui.com/components/text-cast-shadow.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-cast-shadow"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Cast Shadow

> Long shadows fall from the letters across the page, cast by the pointer as a light or by a set sun angle.

Page: https://gelatinui.com/components/text-cast-shadow

## When to use it

Best for: A large heading with a long shadow from a light that the pointer or an angle sets.

- Use `follow` to let the pointer move the light.
- Set `angle` and `length` for a fixed sun.

## Notes for agents

- `angle` is in degrees and `length` is 0 to 1.
- With `follow` on, the shadow falls away from the pointer.

## Anatomy

```text
TextCastShadow
├─ TextCastShadowContent (0..n)
└─ TextCastShadowCanvas (0..n)
```

## API reference

### TextCastShadow

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | A string, or the parts `TextCastShadowContent` and `TextCastShadowCanvas`. |
| `angle` | `number` | 45 | The direction the shadow falls with no mouse, in degrees clockwise from the right: 0 right, 90 down. Default 45 (a sun at the top left). |
| `length` | `number` | 0.6 | The longest shadow, in em of the text. Default 0.6. The canvas reaches this far around it. |
| `follow` | `boolean` | true | True (default): a mouse anywhere on the page is the light, and a closer light throws a longer shadow. Arrow keys turn the light from the keyboard. False: a fixed sun at `angle`. |
| `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"`. |

### TextCastShadowContent

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

### TextCastShadowCanvas

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

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextCastShadow | `text-cast-shadow` |  | `--cast-shadow-text-color`, `--cast-shadow-text-reach` |  |
| TextCastShadowContent | `text-cast-shadow-content` |  |  |  |
| TextCastShadowCanvas | `text-cast-shadow-canvas` |  | `--cast-shadow-text-reach` |  |

## Usage

Put the heading in the Content part and the Canvas after it.

```tsx title="golden-heading.tsx"
import { TextCastShadow, TextCastShadowCanvas, TextCastShadowContent } from "@/components/pro/text/text-cast-shadow";

export function GoldenHeading() {
  return (
    <section className="flex flex-col items-center gap-4 py-16 text-center">
      <h1 className="text-7xl font-semibold tracking-tight">
        <TextCastShadow angle={30} length={0.8}>
          <TextCastShadowContent>Golden hour</TextCastShadowContent>
          <TextCastShadowCanvas />
        </TextCastShadow>
      </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-cast-shadow
```

It adds 33 registry items: 33 files, 4081 lines, and the npm packages `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`.

## 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 Perspective](https://gelatinui.com/components/text-perspective.md)
- [Text Stroke Draw](https://gelatinui.com/components/text-stroke-draw.md)
- [Text Solid Depth](https://gelatinui.com/components/text-solid-depth.md)

## Keyboard

| Keys | Action |
| --- | --- |
| ArrowLeft / ArrowUp | Turns the light 15° back. |
| ArrowRight / ArrowDown | Turns the light 15° on. |
| Home | Puts the light back at `angle`. |
