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
npm install --save-dev ceri-portal
- 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/
.
Name | type | default | description |
---|---|---|---|
target | String | - | where the content will be appended. Defaults to document.body . Uses document.querySelector . |
Clone repository.
npm install
npm run dev
Browse to http://localhost:8080/
.
Copyright (c) 2016 Paul Pflugradt Licensed under the MIT license.