Glimpse

A component that shows a preview of a URL when hovering over a link.

Installation

npx love-ui@latest add glimpse

Usage

import { Glimpse, GlimpseTrigger, GlimpseContent, GlimpseImage, GlimpseTitle, GlimpseDescription } from "@/components/glimpse"
<Glimpse>
  <GlimpseTrigger>
    <a href="https://example.com">Hover to preview</a>
  </GlimpseTrigger>
  <GlimpseContent>
    <GlimpseImage src="/preview.jpg" alt="Preview" />
    <GlimpseTitle>Example Title</GlimpseTitle>
    <GlimpseDescription>A brief description of the link content.</GlimpseDescription>
  </GlimpseContent>
</Glimpse>

Features

  • Fetches data from a URL in a React Server Component
  • Preview a URL when hovering over a link
  • Show title, description, and image
  • Customizable hover card appearance
  • Smooth transitions for hover state
  • Accessible keyboard navigation
  • Touch-friendly for mobile devices
  • Customizable styling through className props
  • Reduced motion support for animations
  • Works with any link or element with role="link"

Examples

Custom styling