Library
Developer Toolspreact-custom-element
Wrap Preact components as standards-based custom elements.
Native PreactActive
Native Preact
Built for Preact and does not require a React compatibility layer.
Packagepreact-custom-element
npm install preact-custom-elementimport register from "preact-custom-element";import { Widget } from "./Widget"; register(Widget, "ph-widget", ["title"]);Introduction
This package is useful when Preact components need to be embedded into non-Preact pages or CMS fragments.
Preact configuration
Register your component with a tag name and optional observed attributes.
SSR notes
Custom elements are usually enhanced on the client.
Islands notes
A good bridge when interactive islands need to be dropped into heterogeneous frontends.