# GrainJS: a light typescript web framework

[![npm version](https://badge.fury.io/js/grainjs.svg)](https://badge.fury.io/js/grainjs)
[![Build status](https://github.com/gristlabs/grainjs/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/gristlabs/grainjs/actions/workflows/build-and-test.yml)
[![codecov](https://codecov.io/gh/gristlabs/grainjs/branch/main/graph/badge.svg?token=1OIMMBLI6N)](https://codecov.io/gh/gristlabs/grainjs)

GrainJS is a JavaScript / TypeScript library for building dynamic web applications.

- It's in part inspired by [React](https://reactjs.org/), but based on observables (like
[Knockout](http://knockoutjs.com/documentation/introduction.html)) instead of virtual dom.
- It is lightweight, has no dependencies, and takes only ~30KB minified.
- It needs no special tooling. It's nothing more than a library.
- It supports convenient DOM-building in JS, event dispatching, DOM event subscriptions,
  disposable components, and in-code CSS styling.
- It's fully typed for use with TypeScript.
- It's proven its worth by powering [Grist](https://github.com/gristlabs/grist-core#grist)'s rich
  frontend app.

## Documentation

For docs, visit [https://gristlabs.github.io/grainjs/](https://gristlabs.github.io/grainjs/).

## Installation

```sh
npm install grainjs
```

Or see [Getting started with GrainJS](https://gristlabs.github.io/grainjs/getting-started.html).

## Examples

See basic examples in [Quick tour](https://gristlabs.github.io/grainjs/#quick-tour) or complete examples
at [Examples](https://gristlabs.github.io/grainjs/examples.html).

## License

GrainJS is licensed under [Apache-2.0 license](https://github.com/gristlabs/grainjs/blob/main/LICENSE).
