Back to Components

Hover Preview

Wrap any trigger to reveal a cursor-following image popover on hover — the thumbnail springs in inside a little browser frame and trails the pointer.

motion

Preview

Hover Atlas or brrt to preview each one.

Installation

Install the component using the CLI.

npx shadcn@latest add https://yash-sakre.github.io/Yash-Sakre/r/hover-preview.json

Usage

Import the component:

import { HoverPreview } from "@/components/ui/hover-preview";

Use it in your code:

<HoverPreview image="/atlas.png" href="https://atlas.dev">
  Atlas
</HoverPreview>

Props

PropertyTypeDefaultDescription
imagestring—Image shown in the popover.
hrefstring—Optional — adds a URL bar to the frame.
childrenReactNode—The trigger element you hover.
widthnumber320Popover width in px.