This example shows most of Remote DOM’s features in action. It includes multiple custom elements with properties, event listeners, and methods. It also shows how you can choose between using an <iframe>
to sandbox remote code, or use Remote DOM’s polyfill to run DOM libraries in a Web Worker.
To show how thin a layer Remote DOM is on top of the basic DOM APIs you may already know, this example implements the “remote” code using a variety of techniques and libraries. In the app/remote/examples
directory You can see the same UI built using:
- “Vanilla” JavaScript, where we use standard DOM APIs to create our tree of elements
- htm
- Preact
- React
- Svelte
- Vue
From the root of the repository, run the following command:
pnpm --filter example-kitchen-sink start