Prompt Buddy logoPrompt Buddy

preact · Preact Docs

Preact Custom Element

Teaches how to wrap Preact components into standard Web Components using the preact-custom-element library, including registering tag names, defining observed attributes, and configuring shadow DOM usage.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

preact-custom-element

Teaches how to wrap Preact components into standard Web Components using the preact-custom-element library, including registering tag names, defining observed attributes, and configuring shadow DOM usage.

When To Use

Use when you need to wrap Preact components as standard Web Components to enable reuse across different frameworks or vanilla HTML environments.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/preact-custom-element-workflow-guide.mdA comprehensive guide covering the essentials, debugging, testing, and advanced usage of the preact-custom-element library.Questions about a comprehensive guide covering the essentials, debugging, testing, and advanced usage of the preact-custom-element li...
examples/preact-custom-element-registration.textA code example demonstrating how to use the preact-custom-element library to register a Preact component as a Web Component with specific attributes and shadow DOM settings.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the preact-custom-element library to register a Preact component as a Web Com...
examples/preact-custom-element-usage.textA text example demonstrating the syntax for using a Preact custom element within HTML.Exact payloads, commands, or snippets shown in A text example demonstrating the syntax for using a Preact custom element within HTML.
examples/preact-custom-element-html-template.textA plain text representation of the HTML structure used to demonstrate a Preact custom element.Exact payloads, commands, or snippets shown in A plain text representation of the HTML structure used to demonstrate a Preact custom element.
examples/preact-custom-element-attribute-change-listener.textA JavaScript example demonstrating how to register a custom element and listen for attribute changes using the preact-custom-element API.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to register a custom element and listen for attribute changes using the preact...
examples/preact-custom-element-component-registration.textA JavaScript code example demonstrating how to define a class component and register it as a custom element using the preact-custom-element library.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to define a class component and register it as a custom element using the...
examples/preact-custom-element-prop-types-registration.textA code example demonstrating how to define a Preact component with PropTypes and register it as a custom element.Exact payloads, commands, or snippets shown in A code example demonstrating how to define a Preact component with PropTypes and register it as a custom element.
examples/preact-custom-element-register-component.textA code example demonstrating how to use the register function to wrap a Preact component as a custom element with shadow DOM enabled.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the register function to wrap a Preact component as a custom element with sha...
examples/preact-custom-element-usage-2.textA text representation of the preact-custom-element guide content demonstrating how to wrap Preact components as Web Components.Exact payloads, commands, or snippets shown in A text representation of the preact-custom-element guide content demonstrating how to wrap Preact components as Web C...

What This Skill Covers

  • Guide Version: 11.x (preview) 10.x (current) 8.x
  • Main sections: Introduction, Essentials, Debug & Test, Advanced, Libraries.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://preactjs.com/guide/v10/preact-custom-element