Reference: Elevate Lookbook | Component: spin_loader/component.rb
4 sizes: xs (16px), sm (20px), md (24px), lg (28px)
XS (16px)
SM (20px)
MD (24px)
LG (28px)
<div class="elv-spin-loader elv-spin-loader--md elv-spin-loader--primary">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22" stroke-width="2.5" stroke-linecap="round"/>
</svg>
</div>
3 color treatments: primary (purple), neutral (gray), inverted (white)
<!-- Primary (purple) -->
<div class="elv-spin-loader elv-spin-loader--md elv-spin-loader--primary">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22" stroke-width="2.5" stroke-linecap="round"/>
</svg>
</div>
<!-- Neutral (gray) -->
<div class="elv-spin-loader elv-spin-loader--md elv-spin-loader--neutral">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22" stroke-width="2.5" stroke-linecap="round"/>
</svg>
</div>
<!-- Inverted (white for dark backgrounds) -->
<div class="elv-spin-loader elv-spin-loader--md elv-spin-loader--inverted">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22" stroke-width="2.5" stroke-linecap="round"/>
</svg>
</div>
Common usage patterns for loading states
Loading content
This may take a few moments...
role="status" and aria-live="polite" to loading containersprefers-reduced-motion by pausing animation for users who need it<div role="status" aria-live="polite">
<div class="elv-spin-loader elv-spin-loader--md elv-spin-loader--primary">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22" stroke-width="2.5" stroke-linecap="round"/>
</svg>
</div>
<span class="elv-sr-only">Loading content</span>
</div>
For users who prefer reduced motion, pause the animation
@media (prefers-reduced-motion: reduce) {
.elv-spin-loader {
animation: none;
/* Show static version or pulse instead */
}
}
| Sizes | XS (16px), SM (20px), MD (24px), LG (28px) |
| Animation | Spin (1s linear infinite) |
| Implementation | SVG arc path with rotating container |
| Primary Color | Stroke: #5746b2 (P100) |
| Neutral Color | Stroke: #6f6d78 (N70) |
| Inverted Color | Stroke: #ffffff |