# Hover card preview

Interactive preview of the CyberSpec Hover card component. A name that previews a small dossier on hover or focus.

[View Hover card preview on CyberSpec](https://www.cyberspec.dev/preview/hover-card)

## About this preview

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.

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

## Example

```tsx
"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

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

## Resources

- [Hover card documentation](https://www.cyberspec.dev/components/sidebar/hover-card.md)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Hover card source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/hover-card.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/hover-card.json)
