Onsen UI Step Counter - Onsen-ui Typing CST Test
Loading…
Onsen UI Step Counter — Onsen-ui Code
Counter app with customizable step increment using Onsen UI components.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsenui.css">
<link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsen-css-components.min.css">
<script src="https://unpkg.com/onsenui/js/onsenui.min.js"></script>
</head>
<body>
<ons-page>
<ons-toolbar>
<div class="center">Step Counter</div>
</ons-toolbar>
<ons-input id="stepInput" placeholder="Step"></ons-input>
<ons-text id="count" style="font-size:24px; display:block; text-align:center; margin:10px;">0</ons-text>
<ons-button onclick="increment()">+</ons-button>
<ons-button onclick="decrement()">-</ons-button>
<ons-button onclick="reset()">Reset</ons-button>
</ons-page>
<script>
let count = 0;
function getStep() { return parseInt(document.getElementById('stepInput').value || '1'); }
function render() { document.getElementById('count').textContent = count; }
function increment() { count += getStep(); render(); }
function decrement() { count -= getStep(); render(); }
function reset() { count = 0; render(); }
</script>
</body>
</html>Onsen-ui Language Guide
Onsen UI is an open-source framework for building hybrid and mobile web apps using HTML5, CSS, and JavaScript. It provides ready-to-use UI components optimized for iOS and Android, supporting frameworks like Angular, React, and Vue.
Primary Use Cases
- ▸Hybrid mobile apps for iOS and Android
- ▸Progressive Web Apps (PWAs)
- ▸Rapid prototyping of mobile interfaces
- ▸Apps needing consistent cross-platform UI
- ▸Integration with Angular, React, or Vue frameworks
Notable Features
- ▸Platform-aware UI components that adapt to iOS and Android styles
- ▸Framework-agnostic core with bindings for Angular, React, and Vue
- ▸Built-in animations and touch gestures
- ▸Lightweight and optimized for performance
- ▸Supports Cordova/Capacitor for native device access
Origin & Creator
Developed by Monaca (Asial Corporation) in 2013, Onsen UI was created to simplify hybrid mobile app development using web technologies while providing native-like UI components.
Industrial Note
Best suited for hybrid apps and progressive web apps requiring native-style UI with minimal platform-specific customization.