A low-profile component framework. 1 file. 1 class. ~350 lines of code. No build tools are required. Native web components. Ideal for JAM stacks. Identical on client & server. Composition oriented. Event delegation by default. Lots of examples. Building a component with Tonic starts by creating a function or a class. The class should have at least one method named render which returns a template literal of HTML. onic is a thin wrapper around web components. Web components require a name with two or more parts. So your class name should be CamelCased (starting with an uppercase letter). Tonic has no templating language, it uses HTML! But since HTML only understands string values, we need some help to pass more complex values to a component, for that we use this.html. There is no evidence that Virtual DOMs improve performance across a broad set of use cases, but it's certain that they greatly increase complexity. Tonic doesn't use them. Instead, we recommend incremental updates.

Features

  • 1 file. 1 class. ~350 lines of code
  • Identical on client & server
  • Event delegation by default
  • Composition oriented
  • Native web components
  • Ideal for JAM stacks

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

MIT License

Follow Tonic

Tonic Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Tonic!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Frameworks

Registered

2022-12-02