@vanillawc/wc-include

1.1.22 • Public • Published

<wc-include> Include HTML from an External Source

GitHub Releases NPM Releases Bundlephobia Latest Status Release Status

Discord Published on WebComponents.org

Installation

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>

Demo

Try it on WebComponents.dev

Usage

Attributes

  • shadow - if present the contents are contained in a shadowDOM

Basic Usage

The src attribute imports the contents of the file into the lightDOM.

<wc-include src="./sample.html"></wc-include>

'shadow' Attribute Usage

When the shadow attribute is specified, the imported contents will be encapsulated in a shadowDOM.

<wc-include src="./sample.html" shadow></wc-include>

Contributing

See CONTRIBUTING.md

Package Sidebar

Install

npm i @vanillawc/wc-include

Weekly Downloads

33

Version

1.1.22

License

MIT

Unpacked Size

8 kB

Total Files

10

Last publish

Collaborators

  • evanplaice