1. Home
  2. /
  3. Uikit
  4. /
  5. Counter Example

Counter Example - Uikit Typing CST Test

Loading…

Counter Example — Uikit Code

Demonstrates a simple counter layout using UIkit classes and minimal JavaScript for interactivity.

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.16.21/dist/css/uikit.min.css">
	<title>UIkit Counter</title>
</head>
<body class="uk-container uk-text-center uk-margin-top">
	<h2>Counter: <span id="count">0</span></h2>
	<div class="uk-button-group">
		<button id="increment" class="uk-button uk-button-primary">+</button>
		<button id="decrement" class="uk-button uk-button-danger">-</button>
		<button id="reset" class="uk-button uk-button-default">Reset</button>
	</div>
	<br>
	<button id="theme-btn" class="uk-button uk-button-warning">Switch Theme</button>

	<script>
		let count = 0;
		let isDark = false;
		const countEl = document.getElementById('count');
		const body = document.body;

		document.getElementById('increment').onclick = () => { count++; countEl.textContent = count; };
		document.getElementById('decrement').onclick = () => { count--; countEl.textContent = count; };
		document.getElementById('reset').onclick = () => { count = 0; countEl.textContent = count; };
		document.getElementById('theme-btn').onclick = () => {
		isDark = !isDark;
		body.classList.toggle('uk-dark', isDark);
		body.classList.toggle('uk-light', !isDark);
		};
	</script>

	<script src="https://cdn.jsdelivr.net/npm/uikit@3.16.21/dist/js/uikit.min.js"></script>
	<script src="https://cdn.jsdelivr.net/npm/uikit@3.16.21/dist/js/uikit-icons.min.js"></script>
</body>
</html>

Uikit Language Guide

UIkit is a lightweight, modular front-end framework for developing fast and powerful web interfaces. It offers a responsive grid, prebuilt components, and JavaScript plugins to create interactive UI elements.

Primary Use Cases

  • ▸Responsive websites and web apps
  • ▸Landing pages and marketing sites
  • ▸Admin dashboards
  • ▸Rapid prototyping
  • ▸Projects needing modular JS components

Notable Features

  • ▸12-column responsive grid system
  • ▸Modular CSS and JS components
  • ▸Prebuilt UI elements (buttons, forms, modals, sliders)
  • ▸JavaScript plugins for interactivity
  • ▸Sass/Less support for theming and customization

Origin & Creator

Created by YOOtheme in 2013 as a modern, modular framework for web interfaces.

Industrial Note

UIkit is often used in web apps, marketing sites, and lightweight dashboards where a modular, customizable, and responsive framework is desired.

More Uikit Typing Exercises

UIkit Navbar ExampleUIkit Card ExampleUIkit Modal ExampleUIkit Tab ExampleUIkit Accordion ExampleUIkit Slideshow ExampleUIkit Tooltip ExampleUIkit Progress Bar Example

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher