Skip to content

    Browse components

    Cosmic Background

    Deep-space nebula clouds with parallax star layers, twinkling flares and the odd shooting star. WebGL.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/cosmic-background

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/cosmic-background.json

    Usage

    import { CosmicBackground } from "@/components/ui/cosmic-background";
    
    <div className="relative h-96">
      <CosmicBackground color="#6d28d9" accent="#db2777" />
    </div>

    Props

    PropTypeDefaultDescription
    colorstring"#6d28d9"Main nebula color.
    accentstring"#db2777"Secondary nebula color.
    speednumber1Drift speed multiplier.
    scalenumber1Size of the nebula clouds.
    intensitynumber1Nebula brightness.
    starsnumber0.5Star density.
    shootingStarsbooleantrueShow an occasional shooting star.
    classNamestring—Extra classes for the root element.