# Moonlit Sea

> A calm sea at night: stars over the horizon, a haloed moon, and a long path of glitter on the water that shivers with every swell. The moon drifts after the cursor.

Category: Backgrounds · MotionKit Plus · Updated 2026-11-10 · Live demo: https://www.motionkitui.com/components/moonlit-sea

## When to use it

Hotels and coastal retreats, sleep and meditation apps, poetry, music and film sites, and any launch that wants a quiet, cinematic night.

## How it works

Everything above the horizon is sky: a gradient lifting towards the moon's colour near the horizon, a soft halo and a crisp disc with faint mottling, and stars placed one per small grid cell by a hash, each twinkling at its own rate. Below the horizon every row is projected into perspective, so the swell gets finer and flatter towards the distance. The moon's path is a band centred under it that widens as it comes towards you, nudged sideways by the waves, and it only sparkles where a fast, fine noise peaks, which reads as wave facets catching the light. The moon eases after the pointer and the path follows it.

## Installation

Part of MotionKit Plus (https://www.motionkitui.com/pricing). Subscribers install it with `npx shadcn@latest add @motionkit/moonlit-sea` after adding their registry token from https://www.motionkitui.com/account.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `[string, string, string]` | `["#0E1630", "#0A1A26", "#F4EEDC"]` | The night sky, the sea and the moonlight. |
| `speed` | `number` | `1` | Swell and glitter speed. 0 holds it still. |
| `moonHeight` | `number` | `0.45` | 0 is a low moon with a long path; 1 is high. |
| `stars` | `boolean` | `true` | Scatter twinkling stars across the sky. |
| `interactive` | `boolean` | `true` | Let the moon follow the pointer slowly. |
| `children` | `ReactNode` |  | Your content, layered above. |

## Accessibility

- **Keyboard: Not applicable.** Decorative, nothing to focus.
- **Screen readers: Pass.** The scene is hidden from assistive tech; only your content is read.
- **Reduced motion: Pass.** With reduced motion on, the night is drawn once and holds still. It also stops rendering off screen.
- **Colour contrast: Pass.** Ivory text measures 15.9:1 on the default night sky. Keep it off the moon and its path.
