Tooltip

Displays rich content in a portal, triggered by a button.

Anatomy

Tooltip do |t|
t.trigger
t.content
end

API Reference

Tooltip

NameTypeDefault
open:booleanfalse
Whether the tooltip should be open by default when initially rendered.
attributeskeyword arguments

Tooltip#trigger

NameTypeDefault
as_child:booleanfalse
When true, merges tooltip trigger behavior with a custom element passed as block content instead of rendering a default div wrapper.
attributeskeyword arguments

Tooltip#content

NameTypeDefault
side:symbol:top
Controls which side of the trigger the content appears on. Options: :top | :bottom | :left | :right
align:symbol:center
Controls the alignment of the content relative to the trigger. Options: :start | :center | :end
attributeskeyword arguments

Keyboard Interactions

KeyDescription
TabOpens/closes the tooltip.
EnterOpens/closes the tooltip.
SpaceOpens/closes the tooltip.
EscCloses the tooltip.

Examples