Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Combines step increment, max limit, auto-reset, history, auto-increment, and theme toggle.
<full-counter>
<h2>Counter: {state.count}</h2>
<div>History: {state.history.join(', ')}</div>
<button onclick={() => { let n=state.count+state.step; if(n>state.max)n=0; state.count=n; state.history.push('Increment'); }}>+</button>
<button onclick={() => { state.count-=state.step; state.history.push('Decrement'); }}>-</button>
<button onclick={() => { state.count=0; state.history.push('Reset'); }}>Reset</button>
<button onclick={() => state.isDark=!state.isDark}>Toggle Theme</button>
<script>
export default {
state: { count: 0, history: [], isDark: false, step: 2, max: 10 },
onMounted() {
setInterval(() => { let n=state.count+state.step; if(n>state.max)n=0; state.count=n; state.history.push('Auto Increment'); }, 1000);
}
}
</script>
</full-counter>Riot.js is a lightweight, client-side JavaScript framework for building web applications with a component-based architecture. It combines simple syntax, a virtual DOM, and reactive data binding to create maintainable, modular UI components.
Origin & Creator
Created by Muut and first released in 2014.
Industrial Note
Riot.js is ideal for developers seeking minimalistic, performant frameworks for modular web apps without the overhead of larger frameworks like React or Angular.