Skip to content

SheetPresenter

Unofficial

Shows a popup element either in place or, on a phone, as a dismissible bottom sheet over a background.

Used by obsidian#Menu.presenter and by other popups that switch to a sheet on phones.

Import:

import type { SheetPresenter } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface SheetPresenter

Properties

PropertyTypeDescription
bgElHTMLElementBackground element placed behind the sheet; clicking it dismisses the popup.
containerElHTMLElementThe popup element being presented.
isSheetbooleanWhether the popup is, or would be, shown as a sheet: the current mode while shown, otherwise whether the device is a phone.
isShownbooleanWhether the popup is currently shown.
isShownAsSheetbooleanWhether the current showing is a sheet, decided on each SheetPresenter.show.

Methods

MethodReturnsDescription
hide(callback?)voidHide the popup, animating the sheet away first when it is shown as one.
show(parentEl, onShowInPlace)voidShow the popup in the given parent.

Links to this page: