BlockSuite API Documentation / @blocksuite/blocks / createLitPortal
Function: createLitPortal()
createLitPortal(
__namedParameters
):HTMLDivElement
Similar to createSimplePortal
, but supports auto update position.
The template should be a static template since it will not be re-rendered.
See createSimplePortal for more details.
Parameters
• __namedParameters: AdvancedPortalOptions
Returns
HTMLDivElement
Example
ts
createLitPortal({
template: RenameModal({
model,
abortController: renameAbortController,
}),
computePosition: {
referenceElement: anchor,
placement: 'top-end',
middleware: [flip(), offset(4)],
autoUpdate: true,
},
abortController: renameAbortController,
});
Defined in
packages/affine/components/dist/portal/helper.d.ts:34