Skip to content
kitn AI/UI

Hover card

kai-hover-card

Shows a profile or a preview behind a trigger, holding real markup rather than plain text.

  • Shadow DOM
  • Hover + focus
  • Auto-flips placement
  • Hover bridge

Put the trigger in the default slot and the panel in slot="card". The card is portaled and positioned inside the shadow root, with a transparent bridge so the pointer can travel in without closing it. It opens on hover and on keyboard focus.

openDelay (default 0) and closeDelay (default 300 ms) tune the timing, and placement steers the panel, which flips to stay in view.

<kai-hover-card placement="top">
<a href="#">@acme</a>
<div slot="card">
<strong>Acme Corp</strong>
<p>Workspace · 24 members</p>
</div>
</kai-hover-card>

Slower to open, so it doesn’t fire on every pass.

The trigger is the default slot; the card is the one named seam:

SlotModePurpose
injectThe TRIGGER the card hovers off. The card body is the `card` slot.
injectThe rich content shown in the floating hover card.
<kai-hover-card>
<kai-avatar src="/jordan.jpg" alt="Jordan Lee"></kai-avatar>
<div slot="card">
<strong>Jordan Lee</strong>
<p>Staff engineer · Platform</p>
</div>
</kai-hover-card>
PropertyTypeDefaultNotes
theme'auto'Color mode (`auto` follows prefers-color-scheme).
openDelay—Delay (ms) before the card opens on hover. Defaults to 0 (focus opens it immediately too).
closeDelay—Delay (ms) before it closes after the pointer leaves. Defaults to 300.
placement—Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'bottom'`; flips to stay in view.
open—Drive/observe the open state: `el.open = true` or the bare `open` attribute. Listen for `kai-open-change`.
defaultOpen—Initial open state on mount (uncontrolled seed).
disabled—Suppress the hover behavior entirely without unmounting.
MethodSignatureNotes
(): voidOpen it programmatically (no-op while disabled).
(): voidClose it programmatically.
(): voidFlip the open state (closes while disabled).

This element wraps these SolidJS components — reach for them directly when you need finer control than the props expose.

HoverCardRootHoverCardTriggerHoverCardContent