Ring progress
The built-in ringprogress tag — a circular donut progress ring with one or more colored sections, a center label, thickness, size, and rounded caps. Usage, options, and live examples.
A built-in tag for a circular (donut) progress ring. Pass sections as a JSON
array of {value, color} objects — one arc per object — and optionally set a
center label, the size and thickness in px, and roundCaps for rounded arc
ends.
Use it as {% ringprogress %} in Markdown, or call it from
Python logic (loops, snippets) via component('aardvark', 'ringprogress', …).
Demonstrations
Single section
The minimal form — one section and a center label:
40%
{% ringprogress sections='[{"value":40,"color":"cyan"}]' label="40%" %}
component('aardvark', 'ringprogress',
sections='[{"value":40,"color":"cyan"}]', label='40%')
Multiple sections
Each object in sections is one colored arc; the values stack around the ring.
size sets the ring’s width and height in px:
70%
{% ringprogress sections='[{"value":40,"color":"cyan"},{"value":15,"color":"orange"},{"value":15,"color":"grape"}]' label="70%" size=140 %}
component('aardvark', 'ringprogress', label='70%', size=140, sections=(
'[{"value":40,"color":"cyan"},'
'{"value":15,"color":"orange"},'
'{"value":15,"color":"grape"}]'))
Thickness and rounded caps
thickness sets the arc width in px; roundCaps rounds the ends of each arc:
65%
{% ringprogress sections='[{"value":65,"color":"teal"}]' label="65%" thickness=16 roundCaps=true size=140 %}
component('aardvark', 'ringprogress',
sections='[{"value":65,"color":"teal"}]',
label='65%', thickness=16, roundCaps=True, size=140)
With other components
Pair a ring with a caption underneath, grouped in a centered
{% stack %}:
82%
Tests passing
{% stack align="center" gap="xs" %}
{% ringprogress sections='[{"value":82,"color":"teal"}]' label="82%" size=120 %}
{% text size="sm" c="dimmed" %}Tests passing{% endText %}
{% endStack %}
component('aardvark', 'ringprogress',
sections='[{"value":82,"color":"teal"}]', label='82%', size=120)
component('aardvark', 'text', size='sm', c='dimmed', children='Tests passing')
Attributes
| Attribute | Valid values | Description |
|---|---|---|
sections |
A JSON array of {value, color} objects |
Required. One arc per object. Invalid JSON degrades to a build-time HTML comment. |
size |
A number of px | Width and height of the ring. Defaults to Mantine’s 120. |
thickness |
A number of px | Arc thickness. Defaults to Mantine’s ~12. |
roundCaps |
bool (default false) |
Round the ends of each arc. |
label |
Any string | Text shown in the center of the ring. |
CSS Selectors
Each ringprogress carries data-aardvark-island="RingProgress" on its wrapper, and Mantine exposes its parts as mantine-RingProgress-* classes — target either to style it from your theme CSS.
[data-aardvark-island="RingProgress"] {
/* style every ringprogress on the page */
}
.mantine-RingProgress-root {
/* the root part */
}
.mantine-RingProgress-svg {
/* the svg part */
}
.mantine-RingProgress-curve {
/* the curve part */
}
.mantine-RingProgress-label {
/* the label part */
}
Injecting Attributes
attr={…} forwards raw HTML attributes (including event handlers) straight onto the rendered element.
40%
{% ringprogress sections='[{"value":40,"color":"cyan"}]' label="40%" attr={'onclick': '''
const value = this.innerText;
console.log('attr demo value:', value);
alert(value);
'''} %}
component('aardvark', 'ringprogress',
sections='[{"value":40,"color":"cyan"}]', label='40%', attr={'onclick': '''
const value = this.innerText;
console.log('attr demo value:', value);
alert(value);
'''})