Hover card

A name that previews a small dossier on hover or focus.

Component

Hover card belongs to the Overlays group in the CyberSpec catalog. It uses @ui-sdk/react/hover-card.

Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/hover-card.json

Example

"use client"

import { HoverCard } from "@/components/ui/hover-card"

export default function HoverCardDemo() {
  return (
    <>
      <p data-kit="hint">
        Contract posted by{" "}
        <HoverCard
          name="Mara Voss"
          role="Fixer"
          href="#mara-voss"
          facts={[
            { label: "District", value: "Lowtide" },
            { label: "Jobs cleared", value: "214" },
          ]}
        />
        , with{" "}
        <HoverCard
          name="Ilya Brandt"
          role="Tech"
          href="#ilya-brandt"
          side="top"
          facts={[
            { label: "Crew", value: "Static Saints" },
            { label: "Rate", value: "¤ 900 / hr" },
          ]}
          code="DOSSIER // NODE 3F:A2"
        />{" "}
        on overwatch.
      </p>
    </>
  )
}

Install this example

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/hover-card-demo.json

Resources

View as Markdown