Skip to Content

Bioluminescence

Interactive ocean cursor effect: a client-side dark water surface where cyan bioluminescent flashes spawn under the moving pointer and fade out. Wraps children; reduced motion keeps the fade and drops the growth.

Installation

pnpm dlx shadcn@latest add @01orbital/bioluminescence

Usage

import { Bioluminescence } from "@/components/scene/bioluminescence"

const COPY = {
  hint: "Move your cursor across the water to reveal its bioluminescence.",
} as const

// The water lights where the cursor moves.
export default function BioluminescenceDemo() {
  return (
    <div className="relative min-h-full w-full flex-1">
      <Bioluminescence className="absolute inset-0" />
      <p className="pointer-events-none absolute inset-x-4 bottom-6 text-center text-sm text-scene-foreground/70">
        {COPY.hint}
      </p>
    </div>
  )
}

This example installs with everything it uses:

pnpm dlx shadcn@latest add @01orbital/bioluminescence-demo

Examples

Kelp Nightbioluminescence-kelp-night

Bioluminescence Kelp Night: an example of bioluminescence.

pnpm dlx shadcn@latest add @01orbital/bioluminescence-kelp-night

Violet Tidebioluminescence-violet-tide

Bioluminescence Violet Tide: an example of bioluminescence.

pnpm dlx shadcn@latest add @01orbital/bioluminescence-violet-tide

API reference

A dark water surface where cyan flashes spawn under the moving pointer and fade out. Children sit on top; reduced motion keeps the fade and drops the growth.

It accepts the HTML attributes of the element it renders.

Dependencies

npm: cn. The CLI installs it for you.

Used in blocks

3 blocks are built with Bioluminescence:

Last updated on