Popover
Floating panel anchored to a trigger.
Use a popover to show short content next to a button: a status filter, column choices or a help note. It uses the native Popover API, so the panel sits in the top layer. NetSuite z-index rules and overflow: hidden containers cannot clip it.
Trigger
Set for to the id of the trigger. A click on the trigger opens the panel. A second click closes it. The trigger can be any element. It must be in the same document as the popover, or in the same shadow root.
The popover sets aria-expanded on the trigger.
Closing
- A click outside the panel closes it.
- Escape closes it.
hide()closes it, and so does removing theopenattribute.
A click inside the panel keeps it open.
Placement
placement sets the side and the edge to line up with the trigger.
| Value | Panel position |
|---|---|
bottom-start | Below the trigger, left edges lined up. The default. |
bottom-end | Below the trigger, right edges lined up. |
top-start | Above the trigger, left edges lined up. |
top-end | Above the trigger, right edges lined up. |
When the panel has no room on its side, it flips to the other side. It always stays 8px inside the window. It follows the trigger when the page scrolls or resizes.
<nsui-popover for="columns" placement="bottom-end">...</nsui-popover>From code
const popover = document.querySelector('nsui-popover');
popover.show();
popover.hide();
popover.toggle();
popover.addEventListener('popovershow', () => console.log('opened'));
popover.addEventListener('popoverhide', () => console.log('closed'));popoverhide fires for every close: a trigger click, Escape, an outside click or hide().
Motion
The panel fades in and moves 4px toward its place in 140ms. It closes faster, in 100ms. A panel opened with the keyboard (Enter or Space on the trigger) does not animate. There is no motion when the system asks for reduced motion.
Browser support
The Popover API needs Chrome 114, Firefox 125 or Safari 17.
API
Attributes
Prop
Type
Events
Prop
Type
Slots
Prop
Type
CSS parts
Prop
Type
Meter
Small ring that shows how much of a limit is used.
Record header
Title line of a record with its status and a foldable band.
NSUI is a community project. It is not an official Oracle NetSuite product. NetSuite is a trademark of Oracle.