HoverCard

A card that opens when you rest on a name, stays while you move onto it and closes when you leave. Overlays.

Open playground

Made by Mira Chen and a very small team.

About

HoverCard is a React component in the Overlays category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { HoverCard } from "@ashutoshswamy/smoui" and set children, content, side.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { HoverCard } from "@ashutoshswamy/smoui";

<HoverCard content={<Profile />}>
  <a href="/mira">Mira Chen</a>
</HoverCard>

Props 3

children

What you point at. Opens on focus too.

ReactNode
content

The card.

ReactNode
side / width / delay

Placement, px width, ms before opening.

"top""bottom" / number / numberdefault "bottom" / 280 / 220