The Placer Toolkit alpha has
arrived! 🎉
Plenty of changes are coming your
way—some big, some breaking, some
even nuclear! Beware the changelog…
Spinner
<pc-spinner> Spinners are used to show the progress of an indeterminate operation.
<pc-spinner></pc-spinner> Demos#
Size#
Spinners are sized based on the current font size. To change the size, set the font-size property on the spinner itself or on a parent element.
Track width#
The width of the spinner’s track can be changed by setting the --track-width custom property.
Colour#
The spinner’s colours can be changed by setting the --indicator-color and --track-color custom properties.
Custom properties#
| Name | Description | Default |
|---|---|---|
--track-width | The width of the track. | 0.125rem |
--track-color | The colour of the track. | var(--pc-color-neutral-fill-normal) |
--indicator-color | The colour of the spinner’s indicator. | var(--pc-color-primary-fill-loud) |
--speed | The time it takes for the spinner to complete one animation cycle. | 2s |
Learn more about customising custom properties.
Parts#
| Name | Description |
|---|---|
base | The component’s base wrapper. |
Learn more about customising CSS parts.
Importing#
If you’re using the autoloader or the standard loader, you can skip this section. But if you’re cherry picking, you can use any of the following snippets to import this component.
To manually import this component from the CDN, copy this code snippet and paste it in your HTML.
<script type="module" src="https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.1/cdn/components/spinner/spinner.js"></script> To manually import this component from the CDN, copy this code snippet and paste it in your JavaScript file.
import "https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.1/cdn/components/spinner/spinner.js"; To manually import this component from npm, copy this code snippet and paste it in your JavaScript file.
import "placer-toolkit/dist/components/spinner/spinner.js";