Installation
$ pnpm dlx shadcn@latest add https://shadercn.vercel.app/r/orb-24.json
Usage
import { Orb24 } from "@/components/orbs/orb-24";<Orb24 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 |
|---|---|---|---|---|
spin | Spin | 0 – 5 | 0.03 | 0.22 |
tilt | Tilt | 0 – 4 | 0.02 | 0.45 |
drift | Terrain drift | 0 – 10 | 0.05 | 0.12 |
season | Season rate | 0 – 10 | 0.05 | 0.3 |
shuffle | Ember rate | 0 – 20 | 0.1 | 0.8 |
radius | Radius | 0.15 – 3 | 0.015 | 1.15 |
blocks | Blocks | 16 – 96 | 1 | 64 |
rough | Mountains | 0 – 0.8 | 0.01 | 0.45 |
scale | Terrain scale | 0.5 – 8 | 0.05 | 2.4 |
sea | Sea level | 0 – 1 | 0.01 | 0.5 |
trees | Trees | 0 – 1 | 0.01 | 0.75 |
cave | Caves | 0 – 1 | 0.01 | 0.4 |
ore | Ore density | 0 – 0.6 | 0.01 | 0.12 |
glow | Ore glow | 0 – 5 | 0.03 | 0.9 |
core | Molten core | 0 – 1 | 0.01 | 0.5 |
texture | Texture grain | 0 – 1 | 0.01 | 0.6 |
light | Key light | 0 – 3 | 0.015 | 1 |
gain | Gain | 0.05 – 5 | 0.05 | 1 |
contrast | Contrast | 0.15 – 10 | 0.05 | 1 |
Colours are passed through colors as hex strings.
| Colour | Label | Default |
|---|---|---|
grass | Grass | #6abe30 |
dirt | Mud | #6f4a2f |
stone | Stone | #8a8a90 |
sand | Sand | #dbcf9c |
water | Water | #2f66d0 |
leaf | Leaves | #3e8f27 |
ore | Ore | #4de3ff |
lava | Lava | #ff7b26 |
Credits
Shader by XorDev, ported from orbkit (WebGL/GLSL) to WebGPU/WGSL.