Hover Card

For sighted users to preview content available behind a link.

Anatomy

HoverCard do |h|
h.trigger
h.content
end

API Reference

HoverCard

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

HoverCard#trigger

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

HoverCard#content

NameTypeDefault
side:symbol:bottom
Controls which side of the trigger the content appears on. Options: :top | :left | :bottom | :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 hover card.
EscCloses the hover card.

Examples