FX · Backgrounds

Stars joined to their nearest neighbours, gently twinkling.

Connect the dots

bash
npx shadcn@latest add https://www.rad-ui.com/r/constellation.json
React
import Constellation from "@/components/fx/constellation" <Constellation className="px-8 py-24"> <h2>Your content</h2> </Constellation>
  • The effect layer is aria-hidden and ignores pointer events; only children are exposed.
  • Pauses offscreen; `paused` stops it on demand (wire it to a visible control if it runs behind reading content).
  • prefers-reduced-motion: reduce (or data-rad-fx-motion="reduce" on an ancestor) keeps the stars steady.
PropTypeDefaultDescription
count
number
34

Number of stars.

color
string
'#c4b5fd'

Star and line colour.

reach
number
16

Max link distance, % of width.

seed
number
21

Change for a different, stable sky.

paused
boolean
false

Stop the animation. It also pauses offscreen.

...props
ComponentProps<'div'>
—

Passed to the root div; children render above.