ShadcnUI.Components.Overlays.HoverCard (shadcn_ui v1.0.0)

Copy Markdown View Source

A complete ordinary link with a supplemental, noninteractive HEEx preview.

The single self-closing trigger slot requires a text label and href, preserving native target, rel, download, current-location and application attributes. inner_block accepts trusted HEEx using p, div, span, strong, em, small, b, i, br, ul, ol, li, h3, h4 and time, with only class, lang, dir and datetime attributes. This deliberately small presentation vocabulary rejects forms, controls, focusable content, scripts, media fetches and nested links. It is a composition guard for trusted HEEx, not an untrusted-HTML sanitizer.

Callers must keep the destination complete and the preview nonessential: no workflow state, authorization result, private data, unique task information, loading state or required action belongs here. Content meaning cannot be inferred from markup. Applications own privacy, freshness and replacement. No interest events, analytics, client fetch, timer, focus movement, touch emulation or top-layer behavior is installed. Touch follows the ordinary link.

Summary

Functions

Renders a link and bounded preview; all required information belongs at the destination.

Functions

hover_card(assigns)

Renders a link and bounded preview; all required information belongs at the destination.

Attributes

  • id (:string) (required)
  • describedby (:string) - Defaults to nil.
  • placement (:atom) - Defaults to :block_end. Must be one of :block_start, :block_end, :inline_start, or :inline_end.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • trigger (required) - Accepts attributes:
    • label (:string) (required)
    • href (:string) (required)
    • target (:string)
    • rel (:string)
    • download (:any)
    • current (:string)
    • class (:any)
    • rest (:map)
  • inner_block (required)