Popover
A floating panel anchored to a trigger, in the top layer; closes on Escape and outside clicks.
Share, filters and a profile card
Share “ray-remote”
Invite
ray.dev/p/ray-remote Copy link
Ada Lovelaceada@ray.devOwner Alan Turingalan@ray.devEditor
Status
Clear Apply
- Following
- 128
- Followers
- 4.2k
Reactions
Placements, width and padding
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().
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
open | open reflects | boolean | Shown. | |
placement | placement reflects | bottom | bottom-start | bottom-end | top | top-start | top-end | left | left-start | left-end | right | right-start | right-end | bottom | Preferred 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). |
offset | offset | number | 8 | Gap to the trigger in px. |
anchor | — | object | What 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. | |
width | width | string | Panel width (px number or CSS length). Default: its content. | |
matchWidth | match-width | boolean | At least as wide as the trigger. | |
padding | padding reflects | 0 | xs | sm | md | lg | md | Panel padding. |
trapFocus | trap-focus | boolean | Moves focus into the panel when opened and keeps Tab inside it. |
| Event | Description |
|---|---|
ray-open | After it opened. |
ray-close | After it closed (also by Escape or an outside click). |
| Slot | Description |
|---|---|
trigger | The element that toggles it (gets aria-haspopup and aria-expanded). |
| (default) | Panel content. |
| Part | Description |
|---|---|
dropdown | The panel. |