No results for this query. Try a shorter phrase, or switch the site language.
Searching…
Use ↑ and ↓ to move, Enter to open and Esc to close.
Counter widget
The complete guide to the WidgetCore Counter widget — starting and ending numbers, animation duration, prefix and suffix, title and description, reduced motion and every style control.
Last updated
The Counter widget animates a number from a starting value to an ending value — once, when the widget scrolls into view. It is built for stats like “1200 active students” or “98% satisfaction”.
Item
Value
Widget name
wgcr-counter
Panel title
Counter
Category
WidgetCore Widgets (wgcr)
Style / script
wgcr-counter / wgcr-counter
Root class
.wgcr-counter
The “Counter” section
Control
ID
Type
Default
Notes
Starting number
start_num
Number
0
The animation starts here
Ending number
end_num
Number
100
The target number
Animation duration (ms)
duration
Number
1500
100–10000 in the control, capped at 10000 in the output
The “Texts” section
Control
ID
Type
Default
Notes
Number prefix
prefix
Text
Empty
Printed before the number, for example “+”
Number suffix
suffix
Text
Empty
Printed after the number, for example “%”
Title
title
Text
“Active students”
Shown under the number
Description
description
Textarea
“A short note about this stat…”
Shown under the title
Title tag
title_tag
Select
H3
H2 to H6 or DIV
Empty parts (prefix, suffix, title, description) are not printed at all.
HTML output
html
<div class="wgcr-counter">
<div class="wgcr-counter-row">
<span class="wgcr-counter-affix">+</span>
<span class="wgcr-counter-num" data-start="0" data-end="100" data-duration="1500">100</span>
<span class="wgcr-counter-affix">students</span>
</div>
<h3 class="wgcr-counter-title">Active students</h3>
<p class="wgcr-counter-desc">A short note about this stat…</p>
</div>
Class
Purpose
.wgcr-counter
Widget root
.wgcr-counter-row
The row of prefix + number + suffix
.wgcr-counter-affix
A prefix or suffix text part
.wgcr-counter-num
The number itself, carrying data-start, data-end and data-duration for the script
.wgcr-counter-title / .wgcr-counter-desc
Title and description
Animation behaviour
The number in the HTML is the ending number from the start, so with JavaScript off the correct value is still shown and nothing is lost for crawlers.
The script waits with an IntersectionObserver (threshold 0.3) until the widget is visible, then counts from start to end with a cubic ease-out curve and sets data-done="1" when finished; the animation never runs twice — not even when the counter sits inside tabs and is shown and hidden repeatedly.
Without IntersectionObserver support the animation runs immediately.
With prefers-reduced-motion: reduce the ending number is written directly, without movement.
Style sections
Number: “Number color”, the number typography, “Prefix and suffix color” and “Number parts gap”.
Title and description: “Title color”, “Description color”, both typographies and “Gap between texts”.
General: “Horizontal alignment” (start / center / end) and a ready-made box group (background, border, shadow, padding, radius).
Custom style example
css
/* A bigger number in the brand color */.wgcr-counter.wgcr-counter-num { font-size: 64px; color: #2e86de; }
.wgcr-counter.wgcr-counter-title { margin-top: 8px; }