# Light Rays

> Rays fanning down from above, slowly turning.

Sun through a window: soft rays from a point on the top edge. For heroes and reveal moments.

- Family: Backgrounds
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/light-rays/
- 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 light-rays
```

It installs to `components/galactrex/light-rays.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 { LightRays } from "@/components/galactrex/light-rays";

<section className="relative overflow-hidden">
  <LightRays />
  <h1 className="relative">First light</h1>
</section>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `rays` | `number` | `14` | How many rays. |
| `origin` | `number` | `50` | Source across the top edge, in %. |
| `speed` | `number` | `18` | Seconds for one turn back and forth; 0 holds still. |
| `intensity` | `number` | `0.32` | Ray strength, 0 to 1. |
| `color` | `string` | `var(--gxui-glow)` | Ray colour. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Centred.** Light from the top centre.
- **Corner.** `origin={10}` for light from one side.

## Accessibility

- Decorative only and aria-hidden; never takes pointer events.

## Motion

- Transform-only rotation of one layer.
- Still offscreen.
- Reduced motion: still rays.
