GitHub

Popover

Rich content popup anchored to a trigger with placement and arrow options.

<rhx-popover>

Examples

Click Trigger

Hover Trigger

Placements

No Arrow

htmx Integration

Properties

Property Type Default Description
rhx-trigger string - CSS selector of the trigger element
rhx-trigger-event string click Trigger event: click, hover
rhx-placement string bottom Position: top, bottom, left, right
rhx-arrow bool true Show a directional arrow

Accessibility

  • Popover has an appropriate role for its content and is linked to its trigger via aria-controls.
  • Focus is managed: when opened, focus moves into the popover; when closed, focus returns to the trigger.
  • Pressing Escape closes the popover and returns focus to the trigger.
  • Click-triggered popovers toggle with the trigger's aria-expanded attribute.