Skip to content
satin

Hover card

A preview of a person, place or file while the pointer rests on its link.

Assigned to Ola Wrona

Installation

Terminal
npm i @uisatin/ui
Import
import { HoverCard } from '@uisatin/ui/hover-card'

About 28.2 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.

First time with Satin? Set it up once, styles and fonts included, with the installation guide.

API Reference

The HoverCard component opens after the pointer rests 400 ms on its trigger (NN/g recommends 0.3–0.5 s) and closes 150 ms after it leaves; keyboard focus opens it too.

PropTypeDefault
trigger
ReactNode
—
children
ReactNode
—
openDelay
number
400
closeDelay
number
150
side
"top""right""bottom""left"
"bottom"
align
"start""center""end"
"start"
open
boolean
—
defaultOpen
boolean
false
onOpenChange
(open: boolean) => void
—
className
string
—
ref
Ref<HTMLElement>
—
...props
ComponentProps<typeof HoverCard.Content>

Other attributes go to the Radix HoverCard.Content part

—

Accessibility

A Radix hover card. It opens when the trigger is hovered or focused, after openDelay, and closes after closeDelay. The card is not in the tab order and is not linked to the trigger, so keyboard and screen-reader users don’t reach what is inside: keep it to extra context the page works without.

KeyAction
TabFocusing the trigger opens the card after openDelay; moving on closes it.
EscCloses the card.