AbstractReadonlyrootReadonlytemplateStaticobservedAttributes to watch for changes for updates.
StaticrootThe mode for this Component's ShadowRoot.
MDN: https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/mode
StaticstyleStyles to encapsulate to this component's root.
StatictagThe HTML tag name to use for this Component
StatictemplateAn HTML Template element for this element to use.
Accessor for live reactive state.
For the full state manipulation API, use getState
Replace the current state with a new value or adopt a whole different State instance
OptionalafterCalled immediately after each template update
ProtectedattributeUse beforeUpdate and afterUpdate instead
OptionalbeforeCalled immediately before each template update
OptionalcomputedAn object or function returning an object which populates the data values
in the templating engine. Such values are accessed using the * notation.
ProtectedconnectedUse script instead
Protecteddisconnecteduse finalize
Publish a CustomEvent with the provided name and options.
Default options are:
{
bubbles: true,
cancelable: true,
composed: true,
detail: undefined,
}
The name of the custom event to publish
Options to configure the custom event
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
OptionalfinalizeFinal lifecycle method called at the end of the unmounting process.
Access the full State instance for this Component.
OptionalinitialThe initial state for this Component
Listen for events on a child element based on the provided query
A function which removes the listener when called
Listen for events on a child element based on the provided component's tag
Attributes to watch for changes for updates.
The mode for this Component's ShadowRoot.
MDN: https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/mode
Styles to encapsulate to this component's root.
The HTML tag name to use for this Component
An HTML Template element for this element to use.
A function which removes the listener when called
Listen for events on the host element
A function which removes the listener when called
Listen for events on the host element
A function which removes the listener when called
OptionalonHandle errors thrown during lifecycle methods of this component or any unhandled errors from child components.
Returns a reference to the HTML Element with the provided ID within the shadow root of this component.
Throws an error if no element with the provided ID is found
Manually schedule a render to occur, optionally providing a callback to invoke after the render completes.
Calling render multiple times in the same event loop won't schedule multiple renders. Renders are scheduled to occur on the next animation frame.
OptionalscriptInitialization lifecycle method. Main scripting and event listeners.
a function to handle cleanup tasks when the component unmounts
Serialize this element to a string
StaticisStaticisStaticread
The Component class extends the base HTMLElement class to provide an ergonomic way to design and develop Web Components with reactive state, managed attributes, and dynamic templating.