@bicycle-codes/tonic
v15.4.14
Published
A component framework.
Downloads
742
Readme
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 @bicycle-codes/tonic
Use
import Tonic from '@bicycle-codes/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>
fork
This is a fork of @socketsupply/tonic
additions
Things added to the forked version
tag
Get the HTML tag name given a Tonic class.
static get tag():string;
class ExampleTwo extends Tonic {
render () {
return this.html`<div>example two</div>`
}
}
ExampleTwo.tag
// => 'example-two'
Useful links
MIT License