- Docs
- Components
- UI & Cards
- Hover Preview
Words that show an image preview on hover
| Name | Type | Default | Description |
|---|---|---|---|
content | string | "" | Text content with placeholders for targets (use {0}, {1}, etc.) |
targets | HoverTarget[] | [] | Array of target configurations with text, imageUrl, linkUrl, and altText |
onTargetClick | (target: HoverTarget, index: number) => void | undefined | Callback when a target is clicked. If not provided and linkUrl exists, opens link in new tab |
imagePosition | "above" | "below" | "left" | "right" | "above" | Position of the image relative to the target text |
enterSpeed | number | 0.2 | Enter animation duration in seconds |
exitSpeed | number | 0.15 | Exit animation duration in seconds |
maxRotation | number | 12 | Maximum rotation angle for the image (in degrees) |
maxOffset | number | 15 | Maximum offset for image movement (in pixels) |
imageWidth | number | 200 | Image width in pixels |
imageHeight | number | 200 | Image height in pixels |
className | string | "" | Additional CSS classes for the container |
targetClassName | string | "" | Additional CSS classes for target text |
targetPadding | number | 4 | Padding around target text to expand hover area (in pixels) |
imageBorderRadius | string | "0.75rem" | Image border radius (CSS value) |
showImageShadow | boolean | true | Show shadow on image preview |
contentstringText content with placeholders for targets (use {0}, {1}, etc.)
""targetsHoverTarget[]Array of target configurations with text, imageUrl, linkUrl, and altText
[]onTargetClick(target: HoverTarget, index: number) => voidCallback when a target is clicked. If not provided and linkUrl exists, opens link in new tab
undefinedimagePosition"above" | "below" | "left" | "right"Position of the image relative to the target text
"above"enterSpeednumberEnter animation duration in seconds
0.2exitSpeednumberExit animation duration in seconds
0.15maxRotationnumberMaximum rotation angle for the image (in degrees)
12maxOffsetnumberMaximum offset for image movement (in pixels)
15imageWidthnumberImage width in pixels
200imageHeightnumberImage height in pixels
200classNamestringAdditional CSS classes for the container
""targetClassNamestringAdditional CSS classes for target text
""targetPaddingnumberPadding around target text to expand hover area (in pixels)
4imageBorderRadiusstringImage border radius (CSS value)
"0.75rem"showImageShadowbooleanShow shadow on image preview
true