Sunlight on the floor of a pool: a shifting web of light over deep water, edged with a faint rainbow, that swells as the cursor passes.
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.
Still waters
Customize
Usage
import { MoonlitSea } from "@/components/motionkit/moonlit-sea";
<MoonlitSea
className="h-[32rem] rounded-3xl"
>
<h1>Your hero</h1>
</MoonlitSea>Motion
The exact curves this component runs, plotted with Motion's own maths.
Swell and glitter
Runs on its own
Moon follows
Pointer moves
Hotels and coastal retreats, sleep and meditation apps, poetry, music and film sites, and any launch that wants a quiet, cinematic night.
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.
| 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. |
How we audit: the WCAG 2.2 animation checklist and respecting reduced motion in React.
Yes. The file starts with "use client", so you can import it straight into a Server Component page or layout. It works in Vite as is, and in Astro as a React island.
Nothing beyond React and Tailwind CSS v4. There is no MotionKit package and no Tailwind config to add.
Yes, with MotionKit Plus. Add the @motionkit registry and your personal token to components.json (the snippet is on your account page), then run npx shadcn@latest add @motionkit/moonlit-sea. It saves the file to components/motionkit and installs its dependencies.
Moonlit Sea is part of MotionKit Plus (£12 / $15 / €14 a month or £96 / $120 / €112 a year). The live preview and playground are free to explore; Plus unlocks its source code, every customisation control and commercial use.
With reduced motion on, the night is drawn once and holds still. It also stops rendering off screen.
Sunlight on the floor of a pool: a shifting web of light over deep water, edged with a faint rainbow, that swells as the cursor passes.
Above the clouds at golden hour: banks of cloud drift past in three depths, lit on the edges facing a glowing sun, parting as the cursor passes.
Ribbons of iridescent glass drifting through the dark, twisting to bright edges side-on and blooming with colour face-on, like light on a soap film.
The live preview is free to explore. Plus unlocks the source for Moonlit Sea and every other premium component.
Not ready for Plus? A free account unlocks 4 premium components, Depth Card, Rolling Text, Dot Wave and Confetti Button, with no card needed.
Customize
Usage
import { MoonlitSea } from "@/components/motionkit/moonlit-sea";
<MoonlitSea
className="h-[32rem] rounded-3xl"
>
<h1>Your hero</h1>
</MoonlitSea>Motion
The exact curves this component runs, plotted with Motion's own maths.
Swell and glitter
Runs on its own
Moon follows
Pointer moves
Still waters