Installation
npm i @vanillawc/wc-include
Import from NPM
<script type="module" src="node_modules/@vanillawc/wc-include/index.js"></script>
Import from CDN
<script type="module" src="https://cdn.jsdelivr.net/gh/vanillawc/wc-include@1/index.js"></script>
Try it on WebComponents.dev
Attributes
- shadow - if present the contents are contained in a shadowDOM
The src
attribute imports the contents of the file into the lightDOM.
<wc-include src="./sample.html"></wc-include>
When the shadow
attribute is specified, the imported contents will be encapsulated in a shadowDOM.
<wc-include src="./sample.html" shadow></wc-include>
See CONTRIBUTING.md