Skip to Content

Stars

Starfield background that fills a positioned parent with a seeded canvas of sharp and soft stars. Optional twinkle and fade-in respect reduced motion, and a circular cutout can hide stars behind an orb.

View as Markdown
pnpm dlx shadcn add @01orbital/stars

The example also uses eyebrow, section, subheading and text. Install them too:

pnpm dlx shadcn add @01orbital/eyebrow @01orbital/section @01orbital/subheading @01orbital/text

Usage

import { Stars } from "@/components/glow/stars"

Examples

API reference

A seeded canvas starfield of near-white stars, some sharp dots and some soft discs, for a dark ground. It fills its positioned parent, redraws when that box resizes, ignores the pointer and is hidden from assistive tech.

animated adds a twinkle and a fade-in, both off under reduced motion. occlude cuts a circular hole so the stars sit behind an orb.

Prop

Type

It also accepts the HTML attributes of the element it renders.

Dependencies

npm: cn. The CLI installs them for you. cn merges Tailwind class names, in place of clsx and tailwind-merge.