Skip to content

API / wxt/utils/content-script-ui/shadow-root / createShadowRootUi

Function: createShadowRootUi() ​

createShadowRootUi<TMounted>(ctx, options): Promise<ShadowRootContentScriptUi<TMounted>>

Source: packages/wxt/src/utils/content-script-ui/shadow-root.ts:20

Create a content script UI inside a ShadowRoot.

This function is async because it has to load the CSS via a network call.

Type Parameters ​

TMounted ​

TMounted

Parameters ​

ctx ​

ContentScriptContext

options ​

ShadowRootContentScriptUiOptions<TMounted>

Shadow root options. See ContentScriptUiOptions for shared positioning, anchoring, append, and removal options.

Returns ​

Promise<ShadowRootContentScriptUi<TMounted>>

See ​

https://wxt.dev/guide/essentials/content-scripts.html#shadow-root


Generated using typedoc-plugin-markdown and TypeDoc