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

Copy Markdown View Source

CSS-first supplemental description for one ordinary button or link.

Use one self-closing trigger slot with a complete text label. The caller selects its native kind, type or destination and application attributes; the component only derives identity and merges describedby references. Disabled buttons remain disabled, so essential help must always be visible elsewhere.

text is escaped plain text, never markup. Required labels, errors, instructions, status and task information belong in visible Help, Alert or page content. This is not an interest invoker or an Escape-dismissable overlay. CSS may reveal the bubble on keyboard focus or fine-pointer hover; no script, focus movement, touch emulation or top-layer behavior is installed.

Summary

Functions

Renders one nonfocusable tooltip and a complete caller-selected native trigger.

Functions

tooltip(assigns)

Renders one nonfocusable tooltip and a complete caller-selected native trigger.

Attributes

  • id (:string) (required)
  • text (: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.
  • surface_rest (:map) - Defaults to %{}.
  • Global attributes are accepted.

Slots

  • trigger (required) - Accepts attributes:
    • label (:string) (required)
    • kind (:atom) - Must be one of :button, or :link.
    • type (:string)
    • disabled (:boolean)
    • name (:string)
    • value (:string)
    • form (:string)
    • href (:string)
    • target (:string)
    • rel (:string)
    • download (:any)
    • current (:string)
    • class (:any)
    • rest (:map)