LineOne's popover: a white card with an arrow next to its trigger, for more than a tooltip holds (text, tags, people, a small form).
<.popover id="lesson">
<:trigger><.button color="primary">Lessons</.button></:trigger>
<:title>Group Lesson</:title>
<p class="mt-2">Lorem ipsum dolor sit amet.</p>
</.popover>
<.popover id="john" trigger_on="hover" placement="top" class="w-48 px-4 py-5 text-center">
<:trigger><div class="avatar size-8">…</div></:trigger>
…
</.popover>The default placement is LineOne's right-start, falling back to the bottom and the top when
there is no room. It opens and closes from the browser (LineaUI.toggle("lesson")), from the
server (LineaUI.close(socket, "lesson")) or from open; a click outside and Esc close it and
on_close runs however it closed.
Summary
Functions
Renders a popover.
Functions
Renders a popover.
Events: on_open and on_close push %{"id" => id} when they are event names.
Attributes
id(:string) (required)open(:boolean) - Defaults tofalse.placement(:string) - Defaults to"right-start". Must be one of"bottom-start","bottom","bottom-end","top-start","top","top-end","left-start","left","left-end","right-start","right", or"right-end".fallbacks(:list) - The sides tried, in order, when the placement has no room. Defaults to["bottom", "top"].offset(:integer) - Pixels between the trigger and the card. Defaults to12.trigger_on(:string) - Defaults to"click". Must be one of"click", or"hover".arrow(:boolean) - Defaults totrue.on_open(:any) - An event name or a%JS{}. Defaults tonil.on_close(:any) - An event name or a%JS{}. Defaults tonil.target(:any) - Thephx-targetofon_open/on_closeevents. Defaults tonil.class(:any) - Merged into the card (max-w-xs,w-72 p-3...). Defaults tonil.- Global attributes are accepted.
Slots
trigger(required)title- LineOne's card title.inner_block