Skip to content

obsidian/popovers/popover

A small floating panel anchored at a point, collecting a value and resolving a promise with it.

This is the popover counterpart of modals/modal.ts: the same “ask the user for a value, resolve a promise” shape, for the cases a modal cannot serve. A modal dims the screen and is positioned by Obsidian, neither of which suits an editor that must appear at the thing it edits — a clicked link, the caret, or wherever a context menu was raised.

The panel rides Obsidian’s .menu class for its background, border and shadow, so only layout is styled by this library.

InterfaceDescription
ShowPopoverBuildParamsThe tools handed to ShowPopoverParams.build for populating a popover.
ShowPopoverParamsParameters for showPopover.
FunctionDescription
showPopoverDisplays a popover at the given anchor and resolves with the built value, or null if it was dismissed without confirming.
TypeDescription
PopoverValueGetterReads the value the popover resolves with when it is confirmed.