āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/elevenlabs/ui/components/orb ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
<ComponentPreview name="orb-demo" title="Orb" description="An animated orb with flowing visuals and volume reactivity." />
npx @elevenlabs/cli@latest components add orb
</TabsContent>
<TabsContent value="manual">
<Steps>
<Step>Install the following dependencies:</Step>
npm install @react-three/drei @react-three/fiber three @three/types
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="orb" title="components/ui/orb.tsx" /><Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsContent> </CodeTabs>import { Orb } from "@/components/ui/orb"
<Orb />
<Orb colors={["#FF6B6B", "#4ECDC4"]} />
function AudioReactiveOrb() {
const getInputVolume = () => {
// Return normalized volume between 0 and 1
return 0.5
}
const getOutputVolume = () => {
// Return normalized volume between 0 and 1
return 0.7
}
return (
<Orb getInputVolume={getInputVolume} getOutputVolume={getOutputVolume} />
)
}
<Orb seed={12345} />
const [agentState, setAgentState] = useState<"thinking" | "listening" | "talking" | null>(null)
<Orb agentState={agentState} />
const [inputVolume, setInputVolume] = useState(0.5)
const [outputVolume, setOutputVolume] = useState(0.7)
<Orb
volumeMode="manual"
manualInput={inputVolume}
manualOutput={outputVolume}
/>
A WebGL-based 3D orb component with audio reactivity and customizable appearance.
| Prop | Type | Default | Description |
| --------------- | ----------------------------- | ------------------------ | ----------------------------------------------------- |
| colors | [string, string] | ["#CADCFC", "#A0B9D1"] | Two color values for the gradient |
| colorsRef | RefObject<[string, string]> | - | Ref for dynamic color updates |
| resizeDebounce | number | 100 | Canvas resize debounce in ms |
| seed | number | Random | Seed for consistent animations |
| agentState | AgentState | null | Agent state: null, "thinking", "listening", "talking" |
| volumeMode | "auto" \| "manual" | "auto" | Volume control mode |
| manualInput | number | - | Manual input volume (0-1) |
| manualOutput | number | - | Manual output volume (0-1) |
| inputVolumeRef | RefObject<number> | - | Ref for input volume |
| outputVolumeRef | RefObject<number> | - | Ref for output volume |
| getInputVolume | () => number | - | Function returning input volume (0-1) |
| getOutputVolume | () => number | - | Function returning output volume (0-1) |
| className | string | - | Custom CSS class |
type AgentState = null | "thinking" | "listening" | "talking"
getInputVolume, getOutputVolume) or refscolorsRef for smooth transitionsā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā