sigilUI

Hover Card

A card that appears on hover with rich preview content. Built on Radix HoverCard with token-driven styling.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { HoverCard, HoverCardTrigger, HoverCardContent } from "@sigil-ui/components";

Usage

<HoverCard>
  <HoverCardTrigger asChild>
    <a href="/profile">@kevin</a>
  </HoverCardTrigger>
  <HoverCardContent>
    <p className="font-semibold">Kevin Liu</p>
    <p className="text-sm text-[var(--s-text-muted)]">Design engineer</p>
  </HoverCardContent>
</HoverCard>

With avatar

<HoverCard>
  <HoverCardTrigger asChild>
    <a href="/user/42">Priya Laghari</a>
  </HoverCardTrigger>
  <HoverCardContent>
    <Stack direction="row" gap={12} align="center">
      <img src="/jane.jpg" alt="" className="size-10 rounded-full" />
      <Stack gap={4}>
        <p className="font-semibold">Priya Laghari</p>
        <p className="text-sm text-[var(--s-text-muted)]">Joined March 2024</p>
      </Stack>
    </Stack>
  </HoverCardContent>
</HoverCard>

Open delay

<HoverCard openDelay={300} closeDelay={100}>
  <HoverCardTrigger>Hover me</HoverCardTrigger>
  <HoverCardContent>Delayed open, fast close.</HoverCardContent>
</HoverCard>

Token integration

CSS VariableUsed for
--s-surfaceContent background
--s-borderContent border
--s-shadow-lgContent elevation
--s-card-radiusBorder radius
--s-duration-fastEnter/exit animation
--s-ease-defaultAnimation easing

Props

HoverCard

PropTypeDefaultDescription
openDelaynumber200Milliseconds before opening
closeDelaynumber150Milliseconds before closing
childrenReactNode—Trigger and content

HoverCardContent

PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left""bottom"Preferred side
align"start" | "center" | "end""center"Alignment
classNamestring—Additional CSS classes
childrenReactNode—Card content

Accessibility

  • Opens on hover and focus for keyboard users
  • Content is announced via aria-describedby
  • Escape key dismisses the card