0.1.0 • Published 7 years ago

ceri-portal v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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-portal

Usage

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

Nametypedefaultdescription
targetString-where the content will be appended. Defaults to document.body. Uses document.querySelector.

Development

Clone repository.

npm install
npm run dev

Browse to http://localhost:8080/.

License

Copyright (c) 2016 Paul Pflugradt Licensed under the MIT license.