{"name":"hover-card","title":"Hover Card","description":"For sighted users to preview content available behind a link.","installCommand":"bunx marko-ui add hover-card -y","usageTags":"<HoverCard>","importSnippet":"import HoverCard from \"@/components/ui/hover-card/hover-card.marko\";","usageSnippet":"<HoverCard>\n  <@trigger|props|>\n    <a ...props href=\"#\">@marko-ui</a>\n  </@trigger>\n  The component registry for Marko 6.\n</HoverCard>","tags":["HoverCard"],"parts":[{"name":"trigger","param":"Record<string, unknown>","description":"Trigger render-prop — typically a link."}],"props":[{"name":"class","type":"string","required":false,"description":"Extra class for the content panel."},{"name":"closeDelay","type":"number | undefined","required":false,"default":"300","description":"The duration from when the mouse leaves the trigger or content until the hover card closes."},{"name":"defaultOpen","type":"boolean | undefined","required":false,"description":"The initial open state of the hover card when rendered.\nUse when you don't need to control the open state of the hover card."},{"name":"defaultTriggerValue","type":"string | null | undefined","required":false,"description":"The initial trigger value when rendered.\nUse when you don't need to control the trigger value."},{"name":"dir","type":"'ltr' | 'rtl' | undefined","required":false,"default":"ltr","description":"The document's text/writing direction."},{"name":"disabled","type":"boolean | undefined","required":false,"description":"Whether the hover card is disabled"},{"name":"getRootNode","type":"(() => ShadowRoot | Document | Node) | undefined","required":false,"description":"A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron."},{"name":"ids","type":"ElementIds | undefined","required":false,"description":"The ids of the elements in the popover. Useful for composition."},{"name":"open","type":"boolean | undefined","required":false,"description":"The controlled open state of the hover card"},{"name":"openDelay","type":"number | undefined","required":false,"default":"600","description":"The duration from when the mouse enters the trigger until the hover card opens."},{"name":"positioning","type":"PositioningOptions | undefined","required":false,"description":"The user provided options used to position the popover content"},{"name":"triggerValue","type":"string | null | undefined","required":false,"description":"The controlled trigger value"}],"events":[{"name":"onFocusOutside","arg":"FocusOutsideEvent","description":"Function called when the focus is moved outside the component"},{"name":"onInteractOutside","arg":"InteractOutsideEvent","description":"Function called when an interaction happens outside the component"},{"name":"onOpenChange","arg":"OpenChangeDetails","description":"Function called when the hover card opens or closes."},{"name":"onPointerDownOutside","arg":"PointerDownOutsideEvent","description":"Function called when the pointer is pressed down outside the component"},{"name":"onTriggerValueChange","arg":"TriggerValueChangeDetails","description":"Function called when the trigger value changes."},{"name":"openChange","arg":"boolean","description":"Fires when the open state changes; receives the plain open value."}],"keyboard":[],"accessibilityNotes":["The trigger only gains hover-card behavior in addition to its native semantics — an `<a>` trigger stays a real, focusable link with its own `href`, so keyboard users can activate it directly even though the card itself opens on hover/focus.","The card opens on trigger focus as well as hover, so keyboard-only users can reveal the preview by tabbing to the trigger — no pointer required.","Closes on `Escape` and on pointer interaction outside the card; `openDelay`/`closeDelay` (default 600ms/300ms on the underlying machine) prevent the card from flickering open during incidental mouse movement."],"examples":[{"id":"hover-card-demo","title":"Basic","source":"import HoverCard from \"@marko-ui/shadcn/ui/hover-card/hover-card.marko\";\n\n<HoverCard>\n  <@trigger|props|>\n    <a ...props href=\"#\" class=\"text-sm font-medium underline underline-offset-4\">\n      @marko-ui\n    </a>\n  </@trigger>\n  <div class=\"flex justify-between gap-4\">\n    <div class=\"space-y-1\">\n      <h3 class=\"text-sm font-semibold\">@marko-ui</h3>\n      <p class=\"text-sm text-muted-foreground\">\n        A shadcn-compatible component registry, ported to Marko 6.\n      </p>\n      <div class=\"text-xs text-muted-foreground\">Joined December 2021</div>\n    </div>\n  </div>\n</HoverCard>","description":"The `trigger` render-prop receives the trigger's props and spreads them onto the element that opens the card; `content` is shown once the pointer lingers."},{"id":"hover-card-sides","title":"Positioning","source":"import HoverCard from \"@marko-ui/shadcn/ui/hover-card/hover-card.marko\";\n\n<div class=\"flex items-center justify-center gap-8\">\n  <HoverCard positioning={ placement: \"top\" }>\n    <@trigger|props|>\n      <a ...props href=\"#\" class=\"text-sm font-medium underline underline-offset-4\">Top</a>\n    </@trigger>\n    <p class=\"text-sm\">Positioned above the trigger.</p>\n  </HoverCard>\n\n  <HoverCard positioning={ placement: \"right\" }>\n    <@trigger|props|>\n      <a ...props href=\"#\" class=\"text-sm font-medium underline underline-offset-4\">Right</a>\n    </@trigger>\n    <p class=\"text-sm\">Positioned to the right of the trigger.</p>\n  </HoverCard>\n\n  <HoverCard positioning={ placement: \"bottom\" }>\n    <@trigger|props|>\n      <a ...props href=\"#\" class=\"text-sm font-medium underline underline-offset-4\">Bottom</a>\n    </@trigger>\n    <p class=\"text-sm\">Positioned below the trigger.</p>\n  </HoverCard>\n</div>","description":"Pass `positioning` with a `placement` to control which side of the trigger the card opens on."},{"id":"hover-card-custom-delays","title":"Custom delays","source":"import HoverCard from \"@marko-ui/shadcn/ui/hover-card/hover-card.marko\";\n\n<HoverCard openDelay=100 closeDelay=100>\n  <@trigger|props|>\n    <a ...props href=\"#\" class=\"text-sm font-medium underline underline-offset-4\">Fast hover</a>\n  </@trigger>\n  <p class=\"text-sm\">This card opens and closes quickly, using a 100ms delay for both.</p>\n</HoverCard>","description":"Use `openDelay` and `closeDelay` (in milliseconds) to control how quickly the card opens and closes."},{"id":"hover-card-disabled","title":"Disabled","source":"import HoverCard from \"@marko-ui/shadcn/ui/hover-card/hover-card.marko\";\n\n<HoverCard disabled>\n  <@trigger|props|>\n    <a ...props href=\"#\" class=\"text-sm font-medium underline underline-offset-4\">Disabled</a>\n  </@trigger>\n  <p class=\"text-sm\">This content never shows — the hover card is disabled.</p>\n</HoverCard>","description":"Pass `disabled` to prevent the hover card from ever opening."},{"id":"hover-card-rtl","title":"RTL","source":"import HoverCard from \"@marko-ui/shadcn/ui/hover-card/hover-card.marko\";\nimport Button from \"@marko-ui/shadcn/ui/button/button.marko\";\n\n<div dir=\"rtl\" class=\"flex flex-wrap justify-center gap-2\">\n  <HoverCard dir=\"rtl\" openDelay=10 closeDelay=100 positioning={ placement: \"left\" }>\n    <@trigger|props|>\n      <Button type=\"button\" ...props variant=\"outline\">يسار</Button>\n    </@trigger>\n    <div dir=\"rtl\" class=\"flex flex-col gap-1\">\n      <div class=\"font-semibold\">سماعات لاسلكية</div>\n      <div class=\"text-sm text-muted-foreground\">٩٩.٩٩ $</div>\n    </div>\n  </HoverCard>\n  <HoverCard dir=\"rtl\" openDelay=10 closeDelay=100 positioning={ placement: \"top\" }>\n    <@trigger|props|>\n      <Button type=\"button\" ...props variant=\"outline\">أعلى</Button>\n    </@trigger>\n    <div dir=\"rtl\" class=\"flex flex-col gap-1\">\n      <div class=\"font-semibold\">سماعات لاسلكية</div>\n      <div class=\"text-sm text-muted-foreground\">٩٩.٩٩ $</div>\n    </div>\n  </HoverCard>\n  <HoverCard dir=\"rtl\" openDelay=10 closeDelay=100 positioning={ placement: \"bottom\" }>\n    <@trigger|props|>\n      <Button type=\"button\" ...props variant=\"outline\">أسفل</Button>\n    </@trigger>\n    <div dir=\"rtl\" class=\"flex flex-col gap-1\">\n      <div class=\"font-semibold\">سماعات لاسلكية</div>\n      <div class=\"text-sm text-muted-foreground\">٩٩.٩٩ $</div>\n    </div>\n  </HoverCard>\n  <HoverCard dir=\"rtl\" openDelay=10 closeDelay=100 positioning={ placement: \"right\" }>\n    <@trigger|props|>\n      <Button type=\"button\" ...props variant=\"outline\">يمين</Button>\n    </@trigger>\n    <div dir=\"rtl\" class=\"flex flex-col gap-1\">\n      <div class=\"font-semibold\">سماعات لاسلكية</div>\n      <div class=\"text-sm text-muted-foreground\">٩٩.٩٩ $</div>\n    </div>\n  </HoverCard>\n</div>","description":"Set `dir=\"rtl\"` on the `HoverCard` (matching the surrounding document direction) so the positioner flips placement automatically."}],"importInstallCommand":"bun add @marko-ui/shadcn marko-zag","body":{"description":"Card content shown when open."},"nativeAttributes":"span","composition":"`HoverCard` is a single component, not three. Where upstream composes `HoverCard` / `HoverCardTrigger` / `HoverCardContent`, this port folds trigger and content into `HoverCard` itself: the `@trigger` render-prop receives the machine's trigger attributes to spread onto whatever element opens the card, and the tag's own body supplies what's shown once the pointer lingers. There is no separate `HoverCardTrigger` or `HoverCardContent` tag to import."}
