This content originally appeared on Bram.us and was authored by Bramus!

A Low Profile Component Framework – Stable, minimal, easy to audit, zero-dependencies and build-tool-free.
Basic component definition is really simple:
import Tonic from "https://cdn.skypack.dev/@optoolco/tonic"
class MyGreeting extends Tonic {
render () {
return this.html`<div>Hello, ${this.props.name ?? 'Stranger'}.</div>`
}
}
Tonic.add(MyGreeting);
Tonic will automatically convert the CamelCased class name to the proper custom element name.
<my-greeting></my-greeting>
<my-greeting name="Bramus"></my-greeting>
Here’s the code above running on CodePen:
See the Pen
Tonic Web Components Demo by Bramus (@bramus)
on CodePen.
Also comes with an SSR package.
Tonic →
Tonic (GitHub) →
Tonic SSR (GitHub) →
This content originally appeared on Bram.us and was authored by Bramus!
Bramus! | Sciencx (2021-10-22T00:00:55+00:00) Tonic — A thin wrapper around Web Components. Retrieved from https://www.scien.cx/2021/10/22/tonic-a-thin-wrapper-around-web-components/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.