Popover

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

Anatomy

Popover do |p|
p.trigger
p.content
end

API Reference

Popover

NameTypeDefault
open:booleanfalse
Controls the initial open state of the popover. When true, the popover content will be visible on render.
attributeskeyword arguments

Popover#trigger

NameTypeDefault
as_child:booleanfalse
When true, merges the trigger functionality with the child element instead of creating a wrapper div.
attributeskeyword arguments

Popover#content

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

Keyboard Interactions

KeyDescription
SpaceOpens/closes the popover.
EnterOpens/closes the popover.
TabMoves focus to the next focusable element.
Shift+TabMoves focus to the previous focusable element.
EscCloses the popver and moves focus to trigger.

Examples