Skip to content

    Browse components

    Beam Splitter

    A slowly rotating glass prism splitting a white beam into a shimmering rainbow fan. Aim the beam with the cursor. WebGL.

    Beam Splitter

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/beam-splitter

    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/beam-splitter.json

    Usage

    import { BeamSplitter } from "@/components/ui/beam-splitter";
    
    <div className="relative h-96">
      <BeamSplitter size={0.2} spread={0.5} />
    </div>

    Props

    PropTypeDefaultDescription
    beamColorstring"#ffffff"Incoming light color.
    speednumber1Rotation speed multiplier.
    sizenumber0.2Prism size, fraction of height.
    spreadnumber0.5Rainbow fan width in radians.
    intensitynumber1Brightness.
    followMousebooleantrueAim the beam from the cursor when it is left of the prism.
    classNamestring—Extra classes for the root element.