ceri-portal
v0.1.0
Published
teleports the content to another location in the dom
Readme
ceri-portal
teleports the content to another location in the dom. Features:
- plain JS - no dependencies
- 14kB unzipped - even smaller when using multiple ceri components
- use in your markup - easy to reason about
Demo
Install
npm install --save-dev ceri-portalUsage
- general ceri component usage instructions
- in your project
window.customElements.define("ceri-portal", require("ceri-portal"))<ceri-portal>
<span>Will be appended to body</span>
</ceri-portal>
<ceri-portal target="#somewhere">
<span>Will be appended to element with ID somewhere</span>
</ceri-portal>For examples see dev/.
Props
Name | type | default | description
---:| --- | ---| ---
target | String | - | where the content will be appended. Defaults to document.body. Uses document.querySelector.
Development
Clone repository.
npm install
npm run devBrowse to http://localhost:8080/.
License
Copyright (c) 2016 Paul Pflugradt Licensed under the MIT license.
