An open API service indexing awesome lists of open source software.

https://github.com/developit/preact-shadow-root

🕴 Render a Preact subtree into the Shadow DOM.
https://github.com/developit/preact-shadow-root

preact preact-components shadow-dom

Last synced: 2 months ago
JSON representation

🕴 Render a Preact subtree into the Shadow DOM.

Awesome Lists containing this project

README

        

# preact-shadow-root

A tiny `` component that renders its children into the Shadow DOM.

🔥 [**JSFiddle Demo**](https://jsfiddle.net/developit/rw72nx24/)

### Usage

```js
import Shadow from 'preact-shadow-root'

const Demo = () => (




I am rendered into the Shadow DOM.
{`
.foo {
border: 2px solid red;
}
`}



)
```

In the above demo, only the `

` within `` will be given a red border.

---

### License

[MIT License](https://oss.ninja/mit/developit) © [Jason Miller](https://jasonformat.com)