Popover
Displays rich content in a floating layer using the native browser popover API and Floating UI for positioning.
Installation
templui add popover
Load the script once in your layout:
<head>
@popover.Script()
</head>
Examples
Basic
Align
With Form
API Reference
Required parameter
Hover for description
Root
Local popover instance that groups one trigger with one content element.
| Name | Type | Default |
|---|---|---|
| | - |
| | - |
| | - |
Trigger
Element inside a Root that opens the matching popover content.
| Name | Type | Default |
|---|---|---|
| | - |
| | - |
| | - |
| | |
Content
Popover content inside the same Root. Placement and closing behavior are configured here.
| Name | Type | Default |
|---|---|---|
| | - |
| | - |
| | - |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
JavaScript API
window.tui.popover.open("root-id");
window.tui.popover.close("root-id");
window.tui.popover.closeAll();
window.tui.popover.toggle("root-id");
const isOpen = window.tui.popover.isOpen("root-id");