A short hint around a trigger (<.tooltip>).
<.tooltip id="save-tip" text="Save the draft">
<.button>Save</.button>
</.tooltip>
<.tooltip id="top-start" text="Top Start" color="success" placement="top-start">
<.button variant="outline">Top Start</.button>
</.tooltip>
<.tooltip id="profile" trigger="click">
<.button>Content</.button>
<:content><div class="p-3">...</div></:content>
</.tooltip>The trigger is the inner block (or, with a <:trigger> slot, the slot, and the inner block is
the hint: <.tooltip id="t"><:trigger><.button>Save</.button></:trigger>Save the draft</.tooltip>); the hint floats next to it (placement, 12 values) in any
color. The LedgerUI.Float hook (priv/static/ledger_ui/hooks/float.js) shows it on hover/focus,
click or never (manual), after delay ms, optionally following the cursor, and flips it when
there is no room. LedgerUI.open/close/toggle("id") show and hide it, open drives it from the
server. on_open / on_close take an event name (payload %{"id" => id}, sent to target) or a %JS{}.
Summary
Functions
Attributes
id(:string) (required)text(:string) - Defaults tonil.color(:string) - Defaults to"neutral". Must be one of"neutral","light","dark","primary","secondary","info","success","warning", or"error".placement(:string) - Defaults to"top". Must be one of"top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start", or"left-end".delay(:integer) - Defaults to0.duration(:integer) - Defaults to300.follow_cursor(:string) - Defaults tonil.Must be one ofnil,"","both","horizontal","vertical", or"initial".arrow(:boolean) - Defaults totrue.interactive(:boolean) - Defaults tonil.open(:boolean) - Defaults tofalse.on_open(:any) - Defaults tonil.on_close(:any) - Defaults tonil.target(:any) - Defaults tonil.class(:any) - Defaults tonil.tip_class(:any) - Defaults tonil.- Global attributes are accepted.
triggeris how it opens:hover(the default),click,focusormanual.content="..."is the text, liketext. Supports all globals plus:["trigger", "content"].
Slots
contenttrigger- The element the hint hangs from; the inner block is then the hint.inner_block(required)