Installation
$ pnpm dlx shadcn@latest add https://shadercn.vercel.app/r/orb-16.json
Usage
import { Orb16 } from "@/components/orbs/orb-16";<Orb16 size={280} state="idle" />Props
Component Props
| Prop | Type | Default | Description |
|---|---|---|---|
state | "idle" | "thinking" | "speaking" | "idle" | Drive preset the orb eases toward |
size | number | 280 | Rendered size in CSS pixels |
params | Partial<Record<string, number>> | - | Shader param overrides, see Shader Props |
colors | Partial<Record<string, string>> | - | Shader colour overrides as hex strings |
statePresets | Partial<Record<OrbState, Record<string, number>>> | - | Replace the built-in per-state param presets |
stateColors | Partial<Record<OrbState, Record<string, string>>> | - | Replace the built-in per-state colours |
stateVolumes | Partial<Record<OrbState, { input?: number; output?: number }>> | - | Pin the drive volumes a state settles on |
volumes | { input?: number; output?: number } | - | Drive the orb directly, bypassing synthesis |
paused | boolean | false | Freeze the frame loop |
pauseOffscreen | boolean | true | Stop rendering while scrolled out of view |
maxDpr | number | 2 | Upper bound on the device pixel ratio |
className | string | - | Class on the wrapper element |
style | CSSProperties | - | Inline style on the wrapper element |
ariaLabel | string | - | Accessible name for the canvas |
Shader Props
Pass any of these through params; each is a single f32 uniform read by the shader.
| Param | Label | Range | Step | Default |
|---|---|---|---|---|
flow | Water flow | 0.015 – 10 | 0.05 | 0.9 |
spin | Turn | 0 – 5 | 0.03 | 0.08 |
swellRate | Surge rate | 0 – 8 | 0.05 | 0.6 |
radius | Radius | 0.15 – 3 | 0.015 | 0.9 |
scale | Net scale | 3 – 30 | 0.1 | 9 |
warp | Ripple depth | 0 – 3 | 0.02 | 0.8 |
edge | Line sharpness | 0.5 – 10 | 0.05 | 2.2 |
split | Colour fringe | 0 – 3 | 0.02 | 0.6 |
swell | Surge depth | 0 – 1 | 0.01 | 0.15 |
gain | Sun power | 0.05 – 6 | 0.05 | 1.6 |
contrast | Tone knee | 0.15 – 6 | 0.05 | 1.1 |
light | Floor light | 0 – 3 | 0.015 | 0.9 |
rim | Rim sheen | 0 – 3 | 0.015 | 0.6 |
Colours are passed through colors as hex strings.
| Colour | Label | Default |
|---|---|---|
deep | Water | #0b2f6e |
sun | Caustic light | #7ff6ff |
sheen | Sheen | #bfe8ff |
Credits
Shader by XorDev, ported from orbkit (WebGL/GLSL) to WebGPU/WGSL.