Skip to content

API > wxt/client > ShadowRootContentScriptUiOptions

Type alias: ShadowRootContentScriptUiOptions<TMounted>

ShadowRootContentScriptUiOptions<TMounted>: ContentScriptUiOptions<TMounted> & object

Type declaration

css

css?: string

Custom CSS text to apply to the UI. If your content script imports/generates CSS and you've set cssInjectionMode: "ui", the imported CSS will be included automatically. You do not need to pass those styles in here. This is for any additional styles not in the imported CSS.

isolateEvents

isolateEvents?: boolean | string[]

When enabled, event.stopPropagation will be called on events trying to bubble out of the shadow root.

  • Set to true to stop the propagation of a default set of events, ["keyup", "keydown", "keypress"]
  • Set to an array of event names to stop the propagation of a custom list of events

mode

mode?: "open" | "closed"

ShadowRoot's mode.

See

https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/mode

Default

ts
"open"

name

name: string

The name of the custom component used to host the ShadowRoot. Must be kebab-case.

onMount

onMount: (uiContainer, shadow, shadowHost) => TMounted

Callback executed when mounting the UI. This function should create and append the UI to the uiContainer element. It is called every time ui.mount() is called.

Optionally return a value that can be accessed at ui.mounted or in the onRemove callback.

Parameters

uiContainer: HTMLElement

shadow: ShadowRoot

shadowHost: HTMLElement

Type parameters

Parameter
TMounted

Source

packages/wxt/src/client/content-scripts/ui/types.ts:97


Generated using typedoc-plugin-markdown and TypeDoc