diff --git a/dev-examples/shadow-dom-web-component/README.md b/dev-examples/shadow-dom-web-component/README.md new file mode 100644 index 00000000000..ac3b4549a9f --- /dev/null +++ b/dev-examples/shadow-dom-web-component/README.md @@ -0,0 +1,169 @@ +# Lexical Web Component (Shadow DOM) Example + +A framework-free [Vite](https://vitejs.dev/) app that packages a Lexical +rich-text editor as a **custom element** (``) whose toolbar, +styles, and `contentEditable` all live inside an **open `ShadowRoot`** — +the scenario from +[facebook/lexical#2119](https://github.com/facebook/lexical/issues/2119), +[#6709](https://github.com/facebook/lexical/issues/6709), and +[#8125](https://github.com/facebook/lexical/issues/8125). + +Where the sibling [`shadow-dom`](../shadow-dom) example demonstrates a React +app with the editor in a shadow root and the toolbar outside it, this one +demonstrates the inverse packaging: a fully self-contained web component. +The demo page mounts four instances — three light-DOM `` +hosts inside the form (a `required` notes editor, a themable summary editor, +and a pre-rendered editor that hydrates from `