Displays a spinner
| 1 |
|
| 2 |
<span is-="spinner"></span> |
| 3 |
<span is-="spinner" variant-="dots"></span> |
| 4 |
<span is-="spinner" variant-="arrows"></span> |
| 5 |
<span is-="spinner" variant-="cross"></span> |
| 6 |
<span is-="spinner" variant-="square"></span> |
| 7 |
<span is-="spinner" variant-="pie"></span> |
| 8 |
<span is-="spinner" variant-="half"></span> |
| 9 |
<span is-="spinner" variant-="bar-vertical"></span> |
| 10 |
<span is-="spinner" variant-="bar-horizontal"></span> |
| 11 |
|
Import
@import '@webtui/css/components/spinner.css';
Usage
<span is-="spinner"></span>
Examples
Variants
| 1 |
<span> |
| 2 |
<span is-="spinner"></span> |
| 3 |
Default (Line) |
| 4 |
</span> |
| 5 |
<span> |
| 6 |
<span is-="spinner" variant-="dots"></span> |
| 7 |
Dots |
| 8 |
</span> |
| 9 |
<span> |
| 10 |
<span is-="spinner" variant-="arrows"></span> |
| 11 |
Arrows |
| 12 |
</span> |
| 13 |
<span> |
| 14 |
<span is-="spinner" variant-="cross"></span> |
| 15 |
Cross |
| 16 |
</span> |
| 17 |
<span> |
| 18 |
<span is-="spinner" variant-="square"></span> |
| 19 |
Square |
| 20 |
</span> |
| 21 |
<span> |
| 22 |
<span is-="spinner" variant-="pie"></span> |
| 23 |
Pie |
| 24 |
</span> |
| 25 |
<span> |
| 26 |
<span is-="spinner" variant-="half"></span> |
| 27 |
Half |
| 28 |
</span> |
| 29 |
<span> |
| 30 |
<span is-="spinner" variant-="bar-vertical"></span> |
| 31 |
Bar Vertical |
| 32 |
</span> |
| 33 |
<span> |
| 34 |
<span is-="spinner" variant-="bar-horizontal"></span> |
| 35 |
Bar Horizontal |
| 36 |
</span> |
| 1 |
|
| 2 |
body { |
| 3 |
display: flex; |
| 4 |
flex-direction: column; |
| 5 |
} |
| 6 |
|
Speed
| 1 |
|
| 2 |
<span> |
| 3 |
<span is-="spinner" speed-="slow"></span> |
| 4 |
Slow |
| 5 |
</span> |
| 6 |
<span> |
| 7 |
<span is-="spinner" speed-="medium"></span> |
| 8 |
Medium |
| 9 |
</span> |
| 10 |
<span> |
| 11 |
<span is-="spinner" speed-="fast"></span> |
| 12 |
Fast |
| 13 |
</span> |
| 14 |
|
| 1 |
|
| 2 |
body { |
| 3 |
display: flex; |
| 4 |
flex-direction: column; |
| 5 |
} |
| 6 |
|
Direction
| 1 |
|
| 2 |
<span> |
| 3 |
<span is-="spinner" variant-="dots"></span> |
| 4 |
Default |
| 5 |
</span> |
| 6 |
<span> |
| 7 |
<span is-="spinner" variant-="dots" direction-="reverse"></span> |
| 8 |
Reverse |
| 9 |
</span> |
| 10 |
|
| 1 |
|
| 2 |
body { |
| 3 |
display: flex; |
| 4 |
flex-direction: column; |
| 5 |
} |
| 6 |
|
Reference
Properties
--spinner-chars: The characters to use for the spinner
--spinner-steps: The number of steps to animate the spinner. Must be equal to the length of --spinner-chars
--spinner-duration: The duration of the spinner animation
.my-spinner {
--spinner-chars: '◐◓◑◒';
--spinner-steps: 4;
--spinner-duration: 1s;
}
Extending
To extend the Spinner stylesheet, define a CSS rule on the components layer
@layer components {
[is-='spinner'] {
&[variant-='numbers'] {
--spinner-chars: '0123456789';
--spinner-steps: 10;
}
}
}
Scope
[is-='spinner'] {
/* ... */
}