0.11.16 • Published 1 year ago
jsvn v0.11.16
JavaScript Views Notation
is a library for describing views using a combination of markup and styles
Features
- Supports view inheritance
- Prevents style mixing between components and libraries, controls css-class dependencies
- Unifies html, css and js
- Unifies templates, allowing you to create templates using React, pure HTML or other renders
- Uses pure ES2020 without transpiles unlike JSX
Documentation
Example
import $$, { View } from 'jsvn';
const MyView = new View({
//CSS (static) styles
background: '#eee',
width: '200px',
textAlign: 'center',
//Inline (dynamic) style
color: m=>m.myColor,
//Child nodes
//Node based on "<div></div>" tag (base by default)
[$$`my-title`]: {
//Text node (simplified notation)
$$: 'JSVN Example',
},
//Node based on "<input/>" tag
[$$`my-input `('/input')]: {
_bind: [m=>m.myText, m=>m.setMyText],
},
[$$(IF)]: m=>m.myText, //Condition for rendering
[$$()]: {//Unnamed node based on "<div></div>" tag (base by default, equal to "[$$('<>div')]")
fontFamily: 'Tahoma, sans-serif',
//Text node
[$$()]: 'Hello ',
//Unnamed node based on "<span></span>" tag
[$$('<>span')]: {
fontWeight : 'bold',
//Text node with dynamic text
$$: m=>`${m.myText}!`,
},
},
});
0.11.15
1 year ago
0.11.16
1 year ago
0.11.11
1 year ago
0.11.12
1 year ago
0.11.13
1 year ago
0.11.14
1 year ago
0.11.9
1 year ago
0.11.10
1 year ago
0.11.8
2 years ago
0.11.6
2 years ago
0.11.7
2 years ago
0.11.3
2 years ago
0.11.4
2 years ago
0.11.5
2 years ago
0.11.0
2 years ago
0.10.1
2 years ago
0.11.1
2 years ago
0.11.2
2 years ago
0.10.0
2 years ago
0.9.1
3 years ago
0.9.0
3 years ago
0.8.0
3 years ago
0.7.4
3 years ago
0.7.3
3 years ago
0.7.2
3 years ago
0.7.1
3 years ago
0.7.0
3 years ago
0.6.0
4 years ago
0.5.1
4 years ago
0.5.0
4 years ago
0.4.3
4 years ago
0.4.1
4 years ago
0.4.0
4 years ago
0.4.2
4 years ago
0.3.3
4 years ago
0.3.2
4 years ago
0.3.1
4 years ago
0.3.0
4 years ago
0.2.1
4 years ago
0.2.0
4 years ago
0.2.2
4 years ago
0.1.8
4 years ago
0.1.7
4 years ago
0.1.6
4 years ago
0.1.5
4 years ago
0.1.4
4 years ago
0.1.2
4 years ago
0.1.3
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago