Hover Preview

Interactive text image previews when hovering over target words.

Built with React, TypeScript, and brought to life with Motion.

Customize

Enter Speed
0.20s
Exit Speed
0.15s
Max Rotation
12°
Max Offset
15px
Image Width
200px
Image Height
200px
Target Padding
4px

Props

15
contentstring

Text content with placeholders for targets (use {0}, {1}, etc.)

Default""
targetsHoverTarget[]

Array of target configurations with text, imageUrl, linkUrl, and altText

Default[]
onTargetClick(target: HoverTarget, index: number) => void

Callback when a target is clicked. If not provided and linkUrl exists, opens link in new tab

Defaultundefined
imagePosition"above" | "below" | "left" | "right"

Position of the image relative to the target text

Default"above"
enterSpeednumber

Enter animation duration in seconds

Default0.2
exitSpeednumber

Exit animation duration in seconds

Default0.15
maxRotationnumber

Maximum rotation angle for the image (in degrees)

Default12
maxOffsetnumber

Maximum offset for image movement (in pixels)

Default15
imageWidthnumber

Image width in pixels

Default200
imageHeightnumber

Image height in pixels

Default200
classNamestring

Additional CSS classes for the container

Default""
targetClassNamestring

Additional CSS classes for target text

Default""
targetPaddingnumber

Padding around target text to expand hover area (in pixels)

Default4
imageBorderRadiusstring

Image border radius (CSS value)

Default"0.75rem"
showImageShadowboolean

Show shadow on image preview

Defaulttrue