Vilqor

Starry Sky Background

Heroes

About

A quiet night sky for dark sections: seeded stars, a few that twinkle, four sparkles and rare shooting stars. Fills its parent and stays still with reduced motion. From the Midnight Lite template (MIT).

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Starry Sky Background to your project and fits it to your theme.

Code

How Starry Sky Background is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import type { CSSProperties } from "react"

import { NightSky } from "@/components/ui/night-sky"

const fraunces =
  "@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..600,0..100;1,9..144,300..600,0..100&display=swap');"

const settings = {
  stars: 170,
  meteors: 3,
  sparkles: true,
  seed: 7,
  paper: "#f7f5f0",
  ink: "#141a2e",
  starColor: "#a5813f",
  accent: "#8a6a2e",
}

export default function Demo(props: Partial<typeof settings>) {
  const s = { ...settings, ...props }
  return (
    <div className="relative flex min-h-svh w-full items-center justify-center overflow-hidden px-6" style={{ background: s.paper }}>
      <style>{fraunces}</style>
      <NightSky
        stars={s.stars}
        seed={s.seed}
        sparkles={s.sparkles}
        meteors={s.meteors}
        starColor={s.starColor}
        accent={s.accent}
        style={{ "--mn-glint": s.accent, "--mn-star-k": "1.8" } as CSSProperties}
      />
      <h2
        className="relative text-center text-[clamp(44px,8vw,96px)] leading-[0.98] tracking-[-0.03em]"
        style={{ color: s.ink, fontFamily: "Fraunces, ui-serif, Georgia, serif", fontWeight: 340, fontVariationSettings: '"SOFT" 60, "opsz" 144' }}
      >
        Your work,
        <br />
        <em style={{ color: s.accent }}>done by morning.</em>
      </h2>
    </div>
  )
}

Dependencies

More by Vilqor

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    41
  • Guilloche Background Pattern

    Guilloche Background Pattern

    3
  • Card Carousel to Grid

    Card Carousel to Grid

  • AI Email Reply with Tones

    AI Email Reply with Tones

  • AI Memory Timeline

    AI Memory Timeline

  • Use Cases Tabs Section

    Use Cases Tabs Section

  • Pricing Section with Toggle

    Pricing Section with Toggle

  • Logo Cloud Marquee

    Logo Cloud Marquee

More in Heroes

View all
  • Responsive Hero Banner

    Responsive Hero Banner

    2.2K
  • SaaS Template

    SaaS Template

    2.7K
  • Hero

    Hero

    1.3K
  • Centered Hero with Image Fan

    Centered Hero with Image Fan

    1.1K
  • Editorial Collage Hero

    Editorial Collage Hero

    507
  • Hero Section

    Hero Section

    445
  • Aero Hero-3

    Aero Hero-3

    618
  • Hero with group of images, text and two buttons

    Hero with group of images, text and two buttons

    442