Web Counter

Display a page-view count on rolling digits styled like a mechanical odometer.

Sample counter

1,234 Page views · last 30 days

Usage

Web Counter HTML
<link rel="stylesheet" href="./styles.css">
<script type="module" src="./index.js"></script>
<web-counter value="1234">
	<output aria-label="Page views">1,234</output>
	<span>Page views</span>
</web-counter>

Save the stylesheet and module beside your HTML file. The output shows the initial count without JavaScript. Set the value attribute to a nonnegative integer to update the wheels.

ES module · Stylesheet · Custom Elements Manifest · Component README