# HoverCard

> Rich preview content shown while hovering a trigger.

- Category: [Overlays](https://tarve.dev/docs.md#overlays)
- Import: `import { HoverCard } from "@tarve/core";`
- Props type: `HoverCardProps`
- Source: [packages/core/src/extra-controls.ts:1124](https://github.com/omarcosr/tarve/blob/main/packages/core/src/extra-controls.ts#L1124)

## Usage

```tsx title="HoverCard.tsx"
import { Avatar, HoverCard, Row, Text } from "@tarve/core";

let open = true;

<HoverCard
  open={open}
  trigger={<Text>@omarcosr</Text>}
  onOpenChange={(next) => {
    open = next;
  }}
>
  <Row gap={12} align="center">
    <Avatar fallback="MR" />
    <Text>Building native UI for Bun.</Text>
  </Row>
</HoverCard>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` (required) | `boolean` | — |  |
| `trigger` (required) | `Child` | — |  |
| `onOpenChange` | `(open: boolean) => void` | — |  |
| `side` | `HoverCardSide` | `"bottom"` |  |
| `width` | `Style["width"]` | `280` |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

## Types

```ts title="HoverCardSide"
type HoverCardSide = "top" | "right" | "bottom" | "left";
```

Previous: [Tooltip](https://tarve.dev/docs/components/Tooltip.md) · Next: [DropdownMenu](https://tarve.dev/docs/components/DropdownMenu.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/HoverCard · Index for agents: https://tarve.dev/llms.txt
