A simple library for creating UI components using virtual DOM.
npm install deku
Read the documentation on the wiki →
- It's small at roughly 8kb.
- Supports npm, Duo, and Bower. Learn More →
- It only supports IE10+ and better browsers. Learn More →
- Server-side rendering.
- Easily test components.
- Handles all event delegation for you without virtual events.
- Batched and optimized updates using
requestAnimationFrame
.
var {component,dom} = require('deku');
var Button = component({
onClick() {
this.setState({ clicked: true });
},
render(props, state) {
return dom('button', { onClick: this.onClick }, [props.text]);
}
});
var scene = Button.render(document.body, {
text: 'Click Me!'
});
scene.setProps({
text: 'Seriously, click me.'
});