Menu
Props
Every prop the component accepts.
Signature
Only animal is required. Everything else has a sensible default.
components/web-pet.tsx
type WebPetProps = {
animal: string;
color?: string;
position?: "fixed" | "absolute";
speed?: number;
scale?: number;
followMouse?: boolean;
hoverMessage?: string;
speech?: { maxWidth?: number; offsetY?: number };
mediaBaseUrl?: string;
zIndex?: number;
style?: CSSProperties;
behavior?: Partial<PetBehavior>;
};Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| animal | string | Required | Folder name under media. |
| color | string | first available | Color variant. |
| position | "fixed" | "absolute" | "fixed" | Roam the viewport or the nearest positioned parent. |
| speed | number | per animal | Pixels per tick. 8 ticks per second. |
| scale | number | 0.5 | Multiplier on the 100 px sprite. |
| followMouse | boolean | false | Chase the cursor instead of wandering. |
| hoverMessage | string | — | Speech bubble shown near the cursor. |
| speech | { maxWidth?, offsetY? } | { 160, 0 } | Bubble width and vertical nudge. |
| mediaBaseUrl | string | "/media" | Where the GIF folders are served from. |
| zIndex | number | 9999 | Stacking order. |
| style | CSSProperties | — | Merged onto the wrapper. |
| behavior | Partial<PetBehavior> | — | Tuning knobs. See Behavior. |