Oscilloscope

A Lissajous figure turning on an analogue oscilloscope.

Still frame of Oscilloscope: a lissajous figure turning on an analogue oscilloscope
Still frame

Installation

pnpm dlx shadcn@latest add @gradients-pro/oscilloscope

Needs a Pro account and the Pro registry setup.

Usage

import { Oscilloscope } from "@/components/oscilloscope";

<Oscilloscope className="h-[560px]">{children}</Oscilloscope>;

It fills its box, so give it a height. Children render on top.

Props

PropTypeDefaultDescription
palette"p31-green", "amber", "ultramarine""p31-green"One of the curated palettes.
appearance"auto", "dark", "light""auto"Which version of the palette to use. auto follows a dark or light class (or data-theme) on <html>, then the OS setting.
colorsstring[]palette2 to 6 CSS colours, var(--x) included. Replaces the palette's colours.
backgroundstringpaletteReplaces the palette's background.
sizenumber10.25 to 4. Size of the figure.
ratiostring"2:3""1:2", "2:3", "3:4" or "3:5". Frequency ratio between the axes, which sets the figure's shape.
glownumber0.450 to 1. Size of the beam's glow.
grainnumber0.120 to 1. Film grain.
speednumber0.60 to 2. How fast it moves; 0 holds a still frame.
paramsPartial<GradientParams>noneAny other engine param, applied last.
classNamestringnoneClasses for the outer box. Give it a size, for example h-[560px].
styleCSSPropertiesnoneInline styles for the outer box.
childrenReactNodenoneContent drawn above the background.