Popover

A floating panel anchored to a trigger, in the top layer; closes on Escape and outside clicks.

Source on GitHub

Share, filters and a profile card
Share
Share “ray-remote”
Invite
  • Ada Lovelaceada@ray.devOwner
  • Alan Turingalan@ray.devEditor
Filters2
Status
ClearApply
Follow
Grace Hopper Compiler engineer. Writes the parts of raylang nobody sees.
Following
128
Followers
4.2k
Reactions

Alan Turing 10:42
The new docs load in half the time. Nice work on the per-page modules!

Placements, width and padding
topplacement="top" rightplacement="right" bottomplacement="bottom" leftplacement="left" match-width: as wide as this buttonThe same width as its trigger. padding lg · offset 16More room, further away.
Code

API

For AI agents: this API as Markdown, or every component in llms-full.txt.

<ray-popover> · RayPopover

Positioned in JS (flip + shift to stay in the viewport). JS: show(), hide(), toggle().

PropertyAttributeTypeDefaultDescription
openopen reflectsbooleanShown.
placementplacement reflectsbottom | bottom-start | bottom-end | top | top-start | top-end | left | left-start | left-end | right | right-start | right-endbottomPreferred side and alignment: top/bottom/left/right are sides of the screen; on top and bottom, -start/-end follow the writing direction (right to left, "bottom-start" lines up the right edges).
offsetoffsetnumber8Gap to the trigger in px.
anchor—objectWhat the panel is placed against instead of the trigger: an element, a DOMRect or a function returning one (a text range, the pointer; read again on every reposition). The trigger still opens it.
widthwidthstringPanel width (px number or CSS length). Default: its content.
matchWidthmatch-widthbooleanAt least as wide as the trigger.
paddingpadding reflects0 | xs | sm | md | lgmdPanel padding.
trapFocustrap-focusbooleanMoves focus into the panel when opened and keeps Tab inside it.
EventDescription
ray-openAfter it opened.
ray-closeAfter it closed (also by Escape or an outside click).
SlotDescription
triggerThe element that toggles it (gets aria-haspopup and aria-expanded).
(default)Panel content.
PartDescription
dropdownThe panel.