Metric Donut Trace
A circular metrics trace draws around a statistics card to highlight the key figure.
A circular metrics trace draws around a statistics card to highlight the key figure.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
<a class="tbx-1128" href="#report"><span class="tbx-1128__chart" aria-hidden="true"><svg viewBox="0 0 120 120"><circle class="tbx-1128__track" cx="60" cy="60" r="46"/><circle class="tbx-1128__fill" cx="60" cy="60" r="46"/></svg><strong>92<small>%</small></strong></span><span class="tbx-1128__copy"><small>CLIENT SATISFACTION</small><strong>Customer satisfaction</strong><span>View results ↗</span></span></a>
.tbx-1128{display:flex;align-items:center;gap:12px;width:min(283px,100%);height:153px;padding:17px;background:#293f50;border-radius:12px;color:#e7f1ef;text-decoration:none;font-family:system-ui,sans-serif;overflow:hidden}.tbx-1128__chart{width:118px;height:118px;flex:none;position:relative;display:grid;place-items:center}.tbx-1128__chart svg{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg);fill:none;stroke-width:9}.tbx-1128__track{stroke:#52717e}.tbx-1128__fill{stroke:#edbf85;stroke-dasharray:289;stroke-dashoffset:289;stroke-linecap:round;transition:stroke-dashoffset .7s cubic-bezier(.15,.65,.2,1)}.tbx-1128__chart strong{font-size:34px;font-weight:850;letter-spacing:-.08em;line-height:1}.tbx-1128__chart strong small{font-size:15px;letter-spacing:0;color:#edbf85}.tbx-1128__copy{display:flex;flex-direction:column;gap:9px;min-width:0}.tbx-1128__copy small{font-size:8px;letter-spacing:.09em;color:#b7cacb;font-weight:800}.tbx-1128__copy strong{font-size:15px;white-space:nowrap}.tbx-1128__copy span{font-size:10px;color:#edbf85}.tbx-1128:is(:hover,:focus-visible) .tbx-1128__fill{stroke-dashoffset:23}.tbx-1128:focus-visible{outline:3px solid #edbf85;outline-offset:3px}@media(prefers-reduced-motion:reduce){.tbx-1128__fill{transition:none!important}.tbx-1128__fill{stroke-dashoffset:23}}
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for statistics sections and company websites.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile: Ensure the interactive content remains accessible without hover on touch devices.
Browser: Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion: Check that prefers-reduced-motion is respected.