A reactive component based UI library used for making user interfaces.
- npm:
npm install nueva
- yarn:
yarn add nueva
- cdn:
<script src="https://unpkg.com/nueva@{latest_version}"></script>
- With package managers
Use rollup or webpack or parcel for bundling. Example config for rollup with plugin-node-resolve
import { nodeResolve } from '@rollup/plugin-node-resolve';
export default {
input: 'entry-point.js',
output: {
file: 'output-file.js',
format: 'es'
},
plugin: [nodeResolve()]
}
Then use nueva, for example
import {
Component,
createElem,
render
} from 'nueva';
class App extends Component {
render() {
return createElem(
'div',
createElem('h1', 'I am H1'),
createElem('h2', 'I am H2')
)
}
}
render(createElem(new App()), document.getElementById('app'))
- For CDN
class App extends nueva.Component {
render() {
return nueva.createElem(
'div',
nueva.createElem('h1', 'I am H1'),
nueva.createElem('h2', 'I am H2')
)
}
}
nueva.render(nueva.createElem(new App()), document.getElementById('app'))