SlopUI.Components.Tooltip (SlopUI v0.1.0)

Copy Markdown View Source

Tooltips.

Summary

Functions

Wraps a trigger with a tooltip.

Functions

tooltip(assigns)

Wraps a trigger with a tooltip.

<.tooltip id="help-tip" text="Opens the help center">
  <.button icon aria-label="Help">?</.button>
</.tooltip>

The trigger gets aria-describedby pointing at the tooltip, so assistive technology reads it regardless of hover state. Shown on hover and on keyboard focus; dismissed with Escape.

Attributes

  • id (:string) (required)
  • text (:string) (required)
  • placement (:string) - Defaults to "top". Must be one of "top", "bottom", "left", or "right".
  • delay (:integer) - ms before showing. Defaults to 300.
  • class (:any) - Defaults to nil.

Slots

  • inner_block (required)