preact-offline

1.0.0 • Public • Published

preact-offline NPM

A (300b gzip) component to render alerts/messages when offline.

Check out the live demo!

This module exposes three module definitions:

  • ES Module: dist/preact-offline.es.js
  • CommonJS: dist/preact-offline.js
  • UMD: dist/preact-offline.min.js

If using the UMD bundle, the library is exposed as preactOffline globally.

Install

$ npm install --save preact-offline

Usage

import { h } from 'preact';
import Offline from 'preact-offline';
 
<Offline />
//=> <div>No connection</div>
 
<Offline id="foo" class="bar">
  <p>Custom Text</p>
</Offline>
//=> <div id="foo" class="bar"><p>Custom Text</p></div>

License

MIT © Luke Edwards

Package Sidebar

Install

npm i preact-offline

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • lukeed