Seed Bible extension API (v1.19.0) / seed-bible/components / usePopover
Function: usePopover()
function usePopover(options: UsePopoverOptions): {
style: CSSProperties | undefined;
};Where a popover goes and how it goes away. It opens below the anchor, or above when there is more room there, lined up with the anchor's nearer edge of the screen, and follows the anchor on scroll and resize. Escape, a press outside, or Tab closes it; Escape and Tab also hand focus back to returnFocusRef. With several open (a menu from a popover), only the newest answers the keys.
Popover and ContextMenuWithButton are built on this. Spread style on a position: fixed element that is portaled to document.body.
Parameters
| Parameter | Type |
|---|---|
options | UsePopoverOptions |
Returns
{
style: CSSProperties | undefined;
}style
style: CSSProperties | undefined;