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.
- Host: GitHub
- URL: https://github.com/developit/preact-shadow-root
- Owner: developit
- Created: 2018-01-19T20:53:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-03-03T20:52:35.000Z (over 5 years ago)
- Last Synced: 2025-04-10T11:16:10.851Z (3 months ago)
- Topics: preact, preact-components, shadow-dom
- Language: JavaScript
- Homepage: https://npm.im/preact-shadow-root
- Size: 4.88 KB
- Stars: 73
- Watchers: 2
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
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)