DevactionUI.Tooltip (devaction_ui v0.1.0)

Copy Markdown View Source

A short hint on hover and on keyboard focus, drawn by CSS only. The trigger is the slot; text is what it says, tied to the trigger with aria-describedby. It is for a name or a short explanation, never for something the person must read to continue.

It appears on the four sides, waits a moment before showing (so passing over a button does not flash), can show the shortcut of the action as a key cap and, with a title, is the rich variant: a heading and a paragraph in a wider box. Every button that is only an icon should have one.

Summary

Functions

tooltip(assigns)

Attributes

  • id (:string) (required)
  • text (:string) (required)
  • placement (:atom) - Defaults to :top. Must be one of :top, :bottom, :left, or :right.
  • shortcut (:string) - the keys of the action, shown as a key cap: ⌘K. Defaults to nil.
  • title (:string) - a heading: makes the rich variant. Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)