ZEBRA

a class-based view framework

Build web UIs with signals and imperative DOM construction. Views are plain classes; you compose element wrappers (Div, Span, ...), wire reactivity with signals and effects, and ship the same code to client or server.


Counter example

import { View, Div, Span, Button, signal } from '@matthewp/zebra';

class Counter extends View {
  count = signal(0);

  render() {
    return new Div().addClass('counter').append(
      new Span().setText(this.count),
      new Button().setText('+').on('click', () => this.count(this.count() + 1)),
    );
  }
}

new Counter().appendTo(document.querySelector('#app'));

Why Zebra


Concepts