DocsEye Tracking

Eye Tracking

Hyper-realistic eyes that follow your cursor with smooth spring physics, reactive pupil dilation, natural blinking, and multiple stunning variants. Move your mouse around to see the magic.

Installation

pnpm dlx shadcn@latest add @componentry/eye-tracking

Dependencies: framer-motion clsx tailwind-merge

Usage

API Reference

PropTypeDefault
eyeSizenumber

Size of each eye in pixels.

120
gapnumber

Gap between eyes in pixels.

40
variant"realistic" | "cartoon" | "minimal" | "cyber"

Visual style variant.

"realistic"
irisColorstring

Primary iris color.

"#4A6741"
irisColorSecondarystring

Secondary iris color for gradient.

"#6B8F62"
pupilColorstring

Color of the pupil.

"#0a0a0a"
scleraColorstring

Color of the sclera (white of the eye).

"#F5F0EB"
pupilRangenumber

How far the pupil can travel (0-1).

0.7
eyeCountnumber

Number of eyes to render.

2
showReflectionboolean

Show light reflection glint on the eye.

true
showIrisDetailboolean

Show iris fiber/pattern details.

true
reactivePupilboolean

Pupil dilates based on cursor proximity.

true
showEyelidsboolean

Show eyelid shadow gradients.

true
blinkIntervalnumber

Blink interval in ms. Set to 0 to disable.

4000
idleAnimationboolean

Subtle random movement when cursor is idle.

true
classNamestring

Additional CSS classes.

—

Working with this component

A decorative reaction

Use the eyes as a playful detail in a hero, empty state, or illustration. Keep instructions and important feedback in text rather than relying on eye movement.

Tune the expression

eyeSize and gap set the proportions, while pupilRange limits how far pupils can move. Try the realistic, cartoon, minimal, and cyber variants against the surrounding interface.

Blinking

blinkInterval is measured in milliseconds; set it to 0 to disable periodic blinking. Check pointer and touch behavior separately, and provide your own motion policy if the surrounding product requires one.

Keep in mind

This component is inspired by various open-source projects and patterns. Please verify licenses and implementation details before using in production.

Need a custom component?

I build bespoke UI components & websites tailored to your brand.

DM me on X
PreviousCollection SurferNextFisheye Infinite Grid
import { EyeTracking } from "@/components/ui/eye-tracking"
 
<EyeTracking eyeSize={140} gap={50} />