https://github.com/jamen/avo
Functions for building UI in JavaScript
https://github.com/jamen/avo
Last synced: 10 months ago
JSON representation
Functions for building UI in JavaScript
- Host: GitHub
- URL: https://github.com/jamen/avo
- Owner: jamen
- License: mit
- Created: 2017-02-10T22:21:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T05:03:53.000Z (over 9 years ago)
- Last Synced: 2025-04-02T18:11:43.438Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 13
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# avo
> Functions for building UI in JavaScript
```js
var {app, html, css} = require('avo')
// ...
```
Three main goals to this:
- Ability to build apps in full JavaScript
- Speedy. Uses Snabby on top of Snabbdom
- Small. No bloat, just separate into packages
## Installation
```sh
$ npm install --save avo
# with Yarn:
$ yarn add avo
```
## Usage
### `avo.app(opts)`
Manages an application's state and routes.
```js
var app = require('avo').app
var start = app({
// Initial state
state: { title: 'foobar' },
// Subscribers
subs: { ... },
// Messages
update: { ... },
// App routes
routes: [
['/', home],
['/foo', foo]
],
})
// Start with DOM entry point
start(document.body)
```
### `avo.html`
A template string tag based on [Snabby](https://github.com/jamen/snabby) that creates your views.
```js
var { app, html } = require('avo')
var foo = html`
Hello world!
`
```
### `avo.css`
A template string tag based on [Sheetify](https://github.com/stackcss/sheetify) that creates your styles
```js
var { app, html, css } = require('avo')
var prefix = css`
:host {
color: red
}
`
var foo = html`
Hello world!
`
```
## License
MIT © [Jamen Marz](https://git.io/jamen)
---
[][package] [](https://travis-ci.org/avo/jamen) [][package] [][package] [][package] [](https://www.paypal.me/jamenmarz/5usd) [](https://github.com/jamen)
[package]: https://npmjs.com/package/avo