CSS
A loader is a tng-loader holding a tng-loader-status, which groups the tng-loader-progress ring and the tng-loader-label. Its width defaults to 191px; set --tng-loader-inline-size to change it. Mount it for the wait and remove it afterwards, or toggle hidden.
<div class="tng-loader"> <div class="tng-loader-status" role="status"> <div class="tng-loader-progress"></div> <p class="tng-loader-label">Loading search results...</p> </div></div>Loading search results...
Elements
Section titled “Elements”Put a decorative tng-icon is-md inside the ring.
<div class="tng-loader"> <div class="tng-loader-status" role="status"> <div class="tng-loader-progress"> <i class="tng-icon is-md icon-ai-sparkle" aria-hidden="true" ></i> </div> <p class="tng-loader-label">Loading search results...</p> </div></div>Loading search results...
Hidden label
Section titled “Hidden label”Add sr-only to keep the label for screen readers when it has to stay off screen.
<div class="tng-loader"> <div class="tng-loader-status" role="status"> <div class="tng-loader-progress"></div> <p class="tng-loader-label sr-only">Loading search results...</p> </div></div>Loading search results...
Action button
Section titled “Action button”A tng-button as a direct child fills the loader’s width.
<div class="tng-loader"> <div class="tng-loader-status" role="status"> <div class="tng-loader-progress"></div> <p class="tng-loader-label">Loading search results...</p> </div> <button class="tng-button is-primary is-lg" type="button"> <span>Reset progress</span> <i class="tng-icon icon-arrow-right" aria-hidden="true"></i> </button></div>Loading search results...
Indeterminate
Section titled “Indeterminate”A ring without aria-valuenow keeps sweeping from 0° to 360°. Under prefers-reduced-motion it holds a static three-quarter arc.
Determinate
Section titled “Determinate”A ring with aria-valuenow stops sweeping and draws --tng-loader-progress, a number from 0 to 1. Update both as loading advances.
<div class="tng-loader"> <div class="tng-loader-status" role="status"> <div class="tng-loader-progress" role="progressbar" aria-labelledby="loader-determinate-label" aria-valuemin="0" aria-valuemax="100" aria-valuenow="40" style="--tng-loader-progress: 0.4" ></div> <p class="tng-loader-label" id="loader-determinate-label"> Loading search results... </p> </div></div>Loading search results...