Installation
$ pnpm dlx shadcn@latest add https://shadercn.vercel.app/r/orb-09.json
Usage
import { Orb09 } from "@/components/orbs/orb-09";<Orb09 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 | Anim speed | 0.015 – 10 | 0.05 | 0.6 |
spin | Roll | 0 – 3 | 0.015 | 0.12 |
tilt | Tilt | -1.5 – 1.5 | 0.015 | 0.4 |
radius | Radius | 0.15 – 3 | 0.015 | 0.9 |
scale | Ring spacing | 0.3 – 20 | 0.1 | 3.5 |
warp | Tear | 0 – 3 | 0.02 | 0.45 |
seed | Ring seed | 0 – 3 | 0.01 | 0.9 |
glow | Ring glow | 0 – 1 | 0.002 | 0.05 |
lineSoft | Ring width | 0.002 – 1 | 0.002 | 0.05 |
inner | Inner falloff | 0.2 – 12 | 0.05 | 3 |
fringe | Rainbow fringe | 0 – 2 | 0.005 | 0.1 |
fringeSoft | Fringe width | 0.001 – 1 | 0.001 | 0.003 |
ringPhase | Ring hue step | 0 – 3 | 0.01 | 0.8 |
exposure | Exposure | 0.05 – 20 | 0.05 | 1.1 |
contrast | Contrast | 0.15 – 10 | 0.05 | 1.1 |
saturation | Saturation | 0 – 4 | 0.02 | 1.2 |
light | Key light | 0 – 3 | 0.015 | 0.5 |
rim | Rim sheen | 0 – 3 | 0.015 | 0.4 |
Colours are passed through colors as hex strings.
| Colour | Label | Default |
|---|---|---|
tint | Tint | #ffffff |
sheen | Sheen | #b9d6ff |
Credits
Shader by XorDev, ported from orbkit (WebGL/GLSL) to WebGPU/WGSL.