Skip to content

BlockSuite API Documentation / @blocksuite/blocks / createButtonPopper

Function: createButtonPopper()

createButtonPopper(reference, popperElement, stateUpdated, mainAxis?, crossAxis?, rootBoundary?): object

Using attribute 'data-show' to control popper visibility.

css
selector {
  display: none;
}
selector[data-show] {
  display: block;
}

Parameters

reference: HTMLElement

popperElement: HTMLElement

stateUpdated= undefined

mainAxis?: number

crossAxis?: number

rootBoundary?: Rect | () => undefined | Rect

Returns

object

dispose()

dispose: () => void

Returns

void

hide()

hide: () => void

Returns

void

show()

show: () => void

Returns

void

toggle()

toggle: () => void

Returns

void

state

get state(): Display

Returns

Display

Source

packages/blocks/src/_common/utils/button-popper.ts:46