Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Link Preview, animated React component

An inline link that lifts a preview card out of the text on hover or keyboard focus. The card rises with a stretch and settles, leans and slides as the pointer moves along the link, and draws its own cover from the title and site when no image is given. Also includes Cursor Card: A preview card trails your cursor through a project list, leans into your movement and swaps content row to row without disappearing.

  • Free
  • Motion Effects
  • Hover
  • Spring

Cursor Card

Like Link Preview? 256 more are in Pro.

Pro unlocks all 256 Pro components, every template and block, and everything we release next. Link Preview stays free.

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

Read the spring guide before you tune the motion, then ship it.

Props

PropTypeDefaultWhat it does
href—Destination: an internal path or a full URL.
children—The link text.
image—Picture for the card. Without one the card draws a cover from the title and site name.
title—Card heading.
description—One or two lines under the heading.
width300Card width in px.
height168Height of the picture area in px.
delay0.08Wait before the card rises, in seconds.
open—Controls the card from outside. Leave unset to open on hover and focus.
autoplayfalseOpens and closes the card on its own until someone hovers or focuses the link.
openInNewTabtrueOpens the link in a new tab.
className—Extra classes for the link.
previewClassName—Extra classes for the floating card.
CursorCard.itemsCURSOR_CARD_ITEMSCursor Card: the rows of the list, each { title, kind, year, colors: [from, to], href? }. Rows without an href only drive the card.
CursorCard.ctaLabel"View case study"Cursor Card: text of the call to action at the foot of the card.
CursorCard.autoplayfalseCursor Card: the card visits each row in turn until someone points at the list or focuses a row. Never runs under reduced motion.
CursorCard.className—Cursor Card: extra classes for the wrapper.

Add it to your project

  1. 1

    Set up your project once

    You need a Next.js project with Tailwind CSS and the @/ import alias. In its root folder, run this once. It creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry

    Run this once per project. It writes the Nexus UI entry into components.json for you:

    npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"

    Type it exactly as shown. {name} is filled in by the CLI with the component you ask for, so you never replace it.

  1. 3

    Add the component

    Run this from your project root. It adds the component, the helpers it imports and its npm packages.

    npx shadcn@latest add @nexus-labs/link-preview
  2. 4

    Check what was added

    With a project made as in the Quick Start (a src/ folder), these files land in it:

    components/
    link-preview/
    cursor-card.tsx
    index.ts
    link-preview.tsx
  3. 5

    Copying by hand? Skip the registry

    Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that cn() exists. Install the packages:

    npm install framer-motion

    Then show the source and create each file at the path it gives:

  4. 6

    Use it in a page

    Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:

    // src/app/page.tsx
    import { LinkPreview } from "@/components/link-preview";
    
    export default function Page() {
      return (
        <main>
          <LinkPreview />
        </main>
      );
    }

Like Link Preview? 256 more are in Pro.

Pro unlocks all 256 Pro components, every template and block, and everything we release next. Link Preview stays free.