Installation
$ pnpm dlx shadcn@latest add https://shadercn.vercel.app/r/orb-27.json
Usage
import { Orb27 } from "@/components/orbs/orb-27";<Orb27 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 |
|---|---|---|---|---|
speed | Front speed | 0.015 – 10 | 0.05 | 0.6 |
spin | Roll | 0 – 5 | 0.03 | 0.04 |
radius | Radius | 0.15 – 3 | 0.015 | 0.9 |
scale | Grid zoom | 0.3 – 8 | 0.05 | 2.4 |
cells | Grid | 8 – 120 | 1 | 34 |
dot | Dot size | 0.1 – 0.5 | 0.01 | 0.36 |
swirl | Swirl | 0 – 8 | 0.05 | 1.5 |
vortex | Vortex size | 0.1 – 2 | 0.01 | 0.45 |
freq | Storm scale | 0.2 – 8 | 0.05 | 1.6 |
warp | Bend | 0 – 3 | 0.02 | 0.5 |
lo | Quiet threshold | 0 – 1 | 0.005 | 0.12 |
hi | Peak threshold | 0 – 1 | 0.005 | 0.82 |
curve | Response curve | 0.5 – 4 | 0.05 | 1.4 |
dither | Class dither | 0 – 0.6 | 0.005 | 0.12 |
sparse | Quiet density | 0 – 1 | 0.01 | 0.16 |
density | Fill | 0 – 1.5 | 0.01 | 1 |
twinkle | Twinkle rate | 0 – 30 | 0.5 | 3 |
grain | Paper grain | 0 – 1 | 0.01 | 0.1 |
light | Key light | 0 – 1 | 0.01 | 0.18 |
rim | Rim | 0 – 1 | 0.01 | 0.35 |
Colours are passed through colors as hex strings.
| Colour | Label | Default |
|---|---|---|
paper | Paper | #efe9dc |
c0 | Quiet | #a9a9a6 |
c1 | Class 1 | #2e5df0 |
c2 | Class 2 | #38d9ec |
c3 | Class 3 | #22c35c |
c4 | Class 4 | #e8322a |
c5 | Class 5 | #f5d020 |
c6 | Peak | #e030c0 |
Credits
Shader by XorDev, ported from orbkit (WebGL/GLSL) to WebGPU/WGSL.