Tooltip -- shows a popup tip over child content on hover.
The tip argument becomes the tip prop.
Props
tip(string) -- tooltip text (set automatically from thetipargument).position(atom) -- tooltip position::top(default),:bottom,:left,:right,:follow_cursor/:follow. SeeToddy.Iced.Position.gap(number) -- gap between tooltip and content in pixels.padding(number) -- tooltip padding in pixels (uniform, not per-side).snap_within_viewport(boolean) -- keep tooltip within viewport. Default: true.delay(non_neg_integer) -- delay in milliseconds before showing the tooltip.style(atom) -- named style (uses container styles). One of::transparent,:rounded_box,:bordered_box,:dark,:primary,:secondary,:success,:danger,:warning.a11y(map) -- accessibility overrides. SeeToddy.Iced.A11y.
Summary
Functions
Sets accessibility annotations.
Converts this tooltip struct to a ui_node() map via the Toddy.Iced.Widget protocol.
Sets the tooltip delay in milliseconds before showing.
Appends multiple children to the tooltip.
Sets the gap between tooltip and content.
Creates a new tooltip struct with the given tip text and optional keyword opts.
Sets the tooltip padding.
Sets the tooltip position.
Appends a child to the tooltip.
Sets whether the tooltip snaps within the viewport.
Sets the tooltip style.
Applies keyword options to an existing tooltip struct.
Types
@type option() :: {:position, Toddy.Iced.Position.t()} | {:gap, number()} | {:padding, number()} | {:snap_within_viewport, boolean()} | {:delay, non_neg_integer()} | {:style, style()} | {:a11y, Toddy.Iced.A11y.t()}
@type preset() :: Toddy.Iced.Widget.Container.preset()
@type style() :: preset() | Toddy.Iced.StyleMap.t()
@type t() :: %Toddy.Iced.Widget.Tooltip{ a11y: Toddy.Iced.A11y.t() | nil, children: [Toddy.Iced.ui_node() | struct()], delay: non_neg_integer() | nil, gap: number() | nil, id: String.t(), padding: number() | nil, position: Toddy.Iced.Position.t() | nil, snap_within_viewport: boolean() | nil, style: style() | nil, tip: String.t() }
Functions
@spec a11y(tooltip :: t(), a11y :: Toddy.Iced.A11y.t()) :: t()
Sets accessibility annotations.
@spec build(tooltip :: t()) :: Toddy.Iced.ui_node()
Converts this tooltip struct to a ui_node() map via the Toddy.Iced.Widget protocol.
@spec delay(tooltip :: t(), delay :: non_neg_integer()) :: t()
Sets the tooltip delay in milliseconds before showing.
@spec extend(tooltip :: t(), children :: [Toddy.Iced.ui_node() | struct()]) :: t()
Appends multiple children to the tooltip.
Sets the gap between tooltip and content.
Creates a new tooltip struct with the given tip text and optional keyword opts.
Sets the tooltip padding.
@spec position(tooltip :: t(), position :: Toddy.Iced.Position.t()) :: t()
Sets the tooltip position.
@spec push(tooltip :: t(), child :: Toddy.Iced.ui_node() | struct()) :: t()
Appends a child to the tooltip.
Sets whether the tooltip snaps within the viewport.
Sets the tooltip style.
Applies keyword options to an existing tooltip struct.