Interactions
Pixel companionFree

Pixel Cat

A tiny pixel-art companion that wanders, reacts to the pointer, changes pose, and responds when petted.

Full-page view

Live preview

Interact with the effect here. Drag, hover, and use its controls.

Click the cat to pet it

Variation Tweaking

Adjust the options and see the preview update live.

Coat
Pose
88
1

Installation

Install automatically via CLI or manually integrate dependencies and code.

$npx @istmx/ui add pixel-cat

Usage

Import the component and configure visual variants, sizes, and operational states.

import { PixelCat } from '@/components/ui/pixel-cat'
 
<PixelCat
breed="orange"
wandering
cursorInteraction
onPet={({ count }) => setPetCount(count)}
/>

Composition

Compose with icons, form triggers, and layout containers.

const [petCount, setPetCount] = React.useState(0)
 
<div className="relative h-64 overflow-hidden rounded-2xl border">
<PixelCat
size={96}
breed="calico"
boundary="parent"
wandering
cursorInteraction
onPet={({ count }) => setPetCount(count)}
/>
</div>
 
<p>Pets: {petCount}</p>

API Reference

Property matrix, types, defaults, and usage descriptions.

PropTypeDefaultDescription
sizenumber36Sprite size in pixels.
breed
'white''orange''black''calico''gray''theme'
'white'Selects the built-in coat palette.
palette
Record<1234, string>
breed paletteOverrides the four sprite colors.
wandering / speedboolean / numbertrue / 1Enable movement and set its speed multiplier.
boundary
'parent''viewport'
'parent'Choose the movement bounds.
position
'random''center'corner{ x, y }
'random'Set the initial sprite position.
initialPose / posePixelCatPose'sit' / undefinedSet the starting pose or lock the sprite to a pose.
interactive / cursorInteractionbooleantrue / trueEnable pet reactions and pointer following.
messages / showBubblestring[] / booleandefault reactions / trueCustomize and show reaction bubbles.
onPet / onPoseChangecallbackundefinedReceive pet counts and pose changes.
padding / className / stylenumber / string / CSSProperties8 / undefined / undefinedConfigure the movement inset and wrapper styles.

Data Attributes

State-reflecting DOM attributes for custom selector styling.

This component does not expose custom data attributes. Standard HTML data attributes are forwarded to its interactive element.

How It Works

Pixel Cat draws its sprite to a pixelated canvas and uses Motion values for smooth movement. It observes its parent or viewport boundary, changes facing and pose as it moves, and emits pet and pose callbacks for application state.

Accessibility

The companion can be paused by disabling wandering. Interactive mode exposes a keyboard-operable pet target, while decorative instances can disable interaction and bubbles.

Keyboard Navigation
TabFocus the companion when interactive.
Enter / SpacePet the companion and trigger its reaction.

Limitations

•The sprite is rendered to canvas and is not a substitute for informative text content.
•Use boundary="parent" inside a positioned container with enough room for movement.

Features

•Six coat palettes and eight poses.
•Parent or viewport wandering boundaries.
•Pointer follow and pet reactions.
•Pose and pet-count callbacks.
•Reduced-motion support.
Credits

Meet the team behind the interaction

Crafted for modern web applications and AI agent workflows.

Aryan

Aryan

@istmX

Building high-performance interfaces, developer tooling, and autonomous agent workflows.

Helped by
Ella

Ella

UI/UX Designer

Crafting beautiful experiences.

Kenji

Kenji

WebGL & Shader Designer

Bringing visuals to life.

Sarah

Sarah

Motion Designer

Animating the details.