domino 0.9.0 copy "domino: ^0.9.0" to clipboard
domino: ^0.9.0 copied to clipboard

An incremental DOM library, with support for virtual DOM and components.

Domino #

Inspired by Google's incremental-dom library, package:domino is a Dart-native DOM library supporting incremental DOM updates, efficient event handling and reuse.

NOTE: early version of the package did use virtual DOM, which is a use-case that can be supported via incremental DOM too.

Usage #

A simple usage example:

import 'dart:html';

import 'package:domino/domino.dart';
import 'package:domino/domino_browser.dart';

void main() {
  registerView(root: document.getElementById('root')!, builderFn: _app);
}

int _counter = 0;

void _app(DomBuilder b) {
  b.open(
    'button',
    id: 'app-button',
    events: {
      'click': (e) {
        _counter++;
        e.view.invalidate();
      },
    },
  );
  b.text('click');
  b.close();

  b.open('span', id: 'app-count');
  b.text('Counter: $_counter');
  b.close();
}
6
likes
155
pub points
48%
popularity

Publisher

verified publisheragilord.com

An incremental DOM library, with support for virtual DOM and components.

Repository (GitHub)
View/report issues

Topics

#dom #html #virtual-dom #javascript #incremental-dom

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

web

More

Packages that depend on domino