Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

preact-shadow-dom

Render your preact component to shadow DOM:

import ShadowDOM from "preact-shadow-dom";

var MyComponent = () => (
	<div className="my-component-class">
		<h1>My Component</h1>
	</div>
);

var ShadowMyComponent = ShadowDOM(MyComponent);

With CSS, injected into the shadow DOM root:

import ShadowDOM from "preact-shadow-dom";
import styles from "styles.css";

var MyComponent = () => (
	<div className="my-component-class">
		<h1>My Component</h1>
	</div>
);

// styles is raw css that will be injected into the shadow dom
var ShadowMyComponent = ShadowDOM(MyComponent, styles);

Related

preact-custom-element

About

HOC that renders component into shadow-dom

Resources

Stars

34 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages