1.0.0 • Published 4 years ago

vanilla-poc-mm v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

GitHub Releases NPM Release Bundlephobia MIT License Published on WebComponents.org Latest Status Release Status

A Vanilla Web Component for including external media, like an iFrame but better


Installation

npm i @vanillawc/wc-include

Then import the index.js file at the root of the package.


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>

Demo

WC-Include-Demo - WebComponents.dev