https://github.com/ryanve/templace
HTML template tag progressive content loader with minimal JavaScript
https://github.com/ryanve/templace
dom javascript progressive-enhancement template
Last synced: about 1 year ago
JSON representation
HTML template tag progressive content loader with minimal JavaScript
- Host: GitHub
- URL: https://github.com/ryanve/templace
- Owner: ryanve
- License: cc0-1.0
- Created: 2018-05-17T04:05:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-12T04:21:26.000Z (over 4 years ago)
- Last Synced: 2025-06-21T22:51:30.541Z (about 1 year ago)
- Topics: dom, javascript, progressive-enhancement, template
- Language: HTML
- Homepage: https://ryanve.github.io/templace/
- Size: 38.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# templace
Progressively load template content via JavaScript. Useful for wrapping low-priority heavy content like `iframe` embeds such to load after initial page load and only when JavaScript is enabled. Gracefully degrades to noop.
```
npm install templace
```
## usage
```html
```
#### Include `script` late in page for best performance benefits
```html
```
#### Templacements happen automagically when the script loads or anytime you invoke the export
```js
templace()
```
#### Normalize `template` CSS for browsers without support
```css
template {
display: none;
}
```
## status
It's a simple minimum viable package with more granular features in consideration
## demo
https://ryanve.github.io/templace/