Skip to main content
NetScriptdocs Search docs ⌘K v0.0.9
Browse documentation

HoverCard

Focus-preserving profile preview on hover or native disclosure activation.

All components · Theme builder · Implementation source

Live preview

Open live hover-card preview

Install

Shell
netscript ui:add hover-card

Usage and examples

The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.

TypeScript
import { useState } from 'preact/hooks';
import { HoverCard } from '@app/components/ui/hover-card.tsx';

export function Example() {
  const [value, setValue] = useState('standard');
  const [open, setOpen] = useState(false);
  const [notice, report] = useState('');
  return (<><div><HoverCard triggerLabel="Maya Rossi" title="Maya Rossi" description="Customer since 2024" /></div><p role="status">{notice}</p></>);
}

Props

Generated from native deno doc --json --private over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.

OwnerPropTypeOptionalDescription
HoverCardPropstriggerLabelstringNo
HoverCardPropstitlestringNo
HoverCardPropsdescriptionComponentChildrenNo
HoverCardPropsmetaComponentChildrenYes
HoverCardPropsavatarComponentChildrenYes
HoverCardPropsplacement"top" | "right" | "bottom" | "left"Yes
HoverCardPropsopenbooleanYes
HoverCardPropsdefaultOpenbooleanYes
HoverCardPropsonOpenChange(open: boolean) => voidYes
HoverCardPropscloseDelaynumberYes
HoverCardPropsdisabledbooleanYes
HoverCardPropsclassstringYes

Keyboard

KeyAction
Enter/SpaceToggle disclosure
EscapeClose only the open preview and return trigger focus.
Tab/Shift+TabNative focus navigation; preview never traps focus or steals it on entry.

Tokens

Semantic contract roles: text/muted.

CSS custom properties referenced directly: --ns-border, --ns-border-width, --ns-card, --ns-card-padding, --ns-fg, --ns-muted-fg, --ns-radius-card, --ns-radius-control, --ns-ring, --ns-shadow-md, --ns-space-1, --ns-space-16, --ns-space-2, --ns-space-4, --ns-text-caption, --ns-text-small, --ns-text-strong, --ns-weight-strong.

Contract and compatibility

Accessibility pattern: WAI-ARIA guidance

  • Public Popover with focusOnOpen=false; hover/focus preview and native disclosure button preserve trigger focus.
  • Mouse hover previews; clicking an already-hovered trigger closes it. Touch/pen use activation-only toggle and pointer-induced focus does not open separately. Pointer transfer grace allows selecting/using preview content. Native focus exit/outside dismissal closes; no backend profile lookup.
  • Runtime trigger/content retain open/closed; root uses rest/open.

Design contract values marked planned are not implementation props. The props above describe what ships today.

Search all documentation

Type a term to search the documentation.