# robot-heads
Animated 3D robot heads for React. Glossy, TV-headed bots with an LED-matrix face that shows what your agent is doing — thinking, searching, listening, speaking and more — in four shapes, with a springy antenna, knob ears and a light on top that changes with the state.
Drawn on a 2D canvas: no WebGL, no runtime dependencies.
**[Playground →](https://robot-heads.fayaz.workers.dev)**
## Install
```bash
npm install robot-heads
```
React 18 or newer is a peer dependency.
## Quick start
```tsx
import { RobotHead } from 'robot-heads';
function Agent({ status }: { status: 'idle' | 'thinking' | 'speaking' }) {
return ;
}
```
## Shapes
One head, four outlines. Every shape carries the same screen, ears, antenna, screws and back panel, and moves the same way.
```tsx
{/* the classic TV (default) */}
{/* a porthole */}
{/* a nut, flat on top */}
```
The list is exported as `robotHeadShapes`.
## States
Each state has its own face on the screen, its own motion and its own antenna light. Switching states plays a short glitch and cross-fade, and the head eases into its new pose.
| State | Screen | Motion |
|---|---|---|
| `idle` | block eyes that blink and glance | looks around, hops now and then |
| `thinking` | heavy-lidded eyes looking up, three pulsing dots | head tilted up, switching sides; amber light pulses |
| `searching` | darting eyes, a beam sweeping the whole screen | head sweeps side to side; cyan beacon |
| `listening` | alert eyes over a live equaliser | head cocked, small nods; steady green light |
| `speaking` | a mouth that moves with the words | bobs as it talks |
| `working` | focused eyes looking down, a progress bar | busy bobbing, a hop with a spin now and then |
| `happy` | `^ ^` eyes and a smile | bouncy hops |
| `error` | red `X X` eyes | shakes its head; red light blinks |
| `sleeping` | closed eyes and rising z's | head drooped, slow breathing; light off |
The list is exported as `robotHeadStates`.
## Props
```tsx
```
Any other attribute (`className`, `style`, `onClick`, `aria-label`, …) goes on the element, and a `ref` reaches the `