@nichoth/tonic
v15.3.4
Published
A component framework.
Downloads
1,030
Readme
A fork of @socketsupply/tonic
Tonic is a low profile component framework for the web. It's one file, less than 3kb gzipped and has no dependencies. It's designed to be used with modern Javascript and is compatible with all modern browsers and built on top of Web Components.
Install
npm install @nichoth/tonic
Use
import Tonic from '@nichoth/tonic'
class MyGreeting extends Tonic {
render () {
return this.html`<div>Hello, World.</div>`
}
}
Tonic.add(MyGreeting, 'my-greeting')
After adding your Javascript to your HTML, you can use your component anywhere.
<html>
<head>
<script src="my-greeting.js"></script>
</head>
<body>
<my-greeting></my-greeting>
</body>
</html>
Useful links
MIT License