LineOne's tooltip (its tippy.js look and options): a hint around a trigger, in every theme color, on twelve placements, after a delay, on hover, click or focus, following the cursor, or holding HTML.
<.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" color="primary">Top Start</.button>
</.tooltip>
<.tooltip id="profile" trigger="click">
<.button>Content</.button>
<:content>
<div class="flex space-x-3 p-3">…</div>
</:content>
</.tooltip>A tooltip is an overlay: LineaUI.open/close/toggle show and hide it by id, and open
drives it from the server (when the assign changes, the server wins).
Summary
Functions
Renders a trigger and its tooltip.
Functions
Renders a trigger and its tooltip.
on_open and on_close take an event name or a JS command; an event's payload is
%{"id" => id} and it goes to target when given.
<.tooltip id="delete-tip" text="Delete forever" color="error" placement="bottom-end" delay={300}>
<.button color="error" icon aria-label="Delete">×</.button>
</.tooltip>From the server: LineaUI.open(socket, "delete-tip"), or bind open={@show_tip}.
Attributes
id(:string) (required)text(:string) - The hint, when there is no:content. Defaults tonil.color(:string) - Defaults to"neutral". Must be one of"neutral","light","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".trigger(:string) -hoveralso shows the hint when the trigger gets the keyboard focus. Defaults to"hover". Must be one of"hover","click","focus", or"manual".delay(:integer) - Milliseconds before the hint shows or hides. Defaults to0.duration(:integer) - Milliseconds the animation lasts. Defaults to300.follow_cursor(:string) -initialplaces the hint where the pointer was when it showed. Defaults tonil. Must be one ofnil,"both","horizontal","vertical", or"initial".arrow(:boolean) - Defaults totrue.interactive(:boolean) - Whether the pointer can move onto the hint; on by default with:content. 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) - Classes for the hint's box. Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)content- HTML content: drawn without padding, LineOne'scontenttheme.