Hover Card

For sighted users to preview content available behind a link. Built on Base UI's preview card primitive.

Last updated January 1, 1980

CreditsUnchangedPublished

Copied from shadcn/ui.

Overview

Installation

Usage

import {
 
  HoverCard,
  HoverCardContent,
  HoverCardTrigger,
} from "@/components/ui/hover-card"
 
export function Example() {
  return (
    <HoverCard>
      <HoverCardTrigger href="#">@shadcn</HoverCardTrigger>
      <HoverCardContent>Preview content</HoverCardContent>
    </HoverCard>
  )
}

Examples

RTL

Base UI reports the popup's resolved side as inline-start / inline-end rather than a fixed left/right, so positioning and entry animation stay correct under RTL without any extra work.

API Reference

HoverCard

HoverCardContent