Home

Awesome

Web Component Spinners

npm npm Netlify Status

Web Component implementations of

Installation

yarn add wc-spinners

OR

npm i --save wc-spinners

Usage

Javascript

  import 'wc-spinners';
  
  const spinner = document.createElement('atom-spinner');
  document.body.append(spinner);

or for a specific spinner

  import 'wc-spinners/dist/atom-spinner.js';

  const spinner = document.createElement('atom-spinner');
  document.body.append(spinner);

HTML

<body>
  <atom-spinner></atom-spinner>

  <script src="wc-spinners.js"></script>
</body>

or for a specific spinner

<body>
  <atom-spinner></atom-spinner>

  <script src="wc-spinners/dist/atom-spinner.js"></script>
</body>

Configuration

You can easily configure a spinner's display by either setting an attribute on the spinner element or by assigning a value to a corresponding css variable.

Note: When setting an attribute the unit is implied (e.g. size="60" becomes 60px automatically). If you want to change the unit type, use css variables instead (--spinner__size: 60rem)

Attributes

<atom-spinner
  color="#ff1d5e"
  duration="1"
  size="60"
></atom-spinner>

CSS Variables (CSS Custom Properties)

<style>
  atom-spinner {
    --atom-spinner__color: #ff1d5e;
    --atom-spinner__duration: 1s;
    --atom-spinner__size: 60px;
  }
</style>

<atom-spinner></atom-spinner>

Attribute list

Epic Spinners

NOTE: count is not supported by css variables

Default color: #ff1d5e

Spinnersizedurationcount
atom-spinner601
breeding-rhombus-spinner6523
circles-to-rhombuses-spinner151.2
fingerprint-spinner641.5
flower-spinner702.5
fulfilling-bouncing-circle-spinner504
fulfilling-square-spinner504
half-circle-spinner601
hollow-dots-spinner1513
intersecting-cirlces-spinner351.2
looping-rhombuses-spinner152.5
orbit-spinner551.2
pixel-spinner702
radar-spinner602
scaling-squares-spinner651.25
self-fulfilling-square-spinner106
semipolar-spinner652
spring-spinner603
swapping-squares-spinner651
trinity-rings-spinner601.5

React Spinners

Default color: #36d7b7

Spinnersizeheightwidthradiusmargin
bar-spinner4100
beat-spinner152
bounce-spinner60
circle-spinner60
climbing-box-spinner15
clip-spinner35
dot-spinner60
fade-spinner15510
grid-spinner152
hash-spinner50
moon-spinner60
pacman-spinner252
propagate-spinner15
pulse-spinner152
ring-spinner60
rise-spinner152
rotate-spinner155
scale-spinner35422
skew-spinner20
square-spinner50
sync-spinner152

React Spinners CSS

Default color: #7f58af

Spinnersize
rsc-circle-spinner64
default-spinner80
dual-ring-spinner80
ellipsis-spinner80
facebook-spinner80
rsc-grid-spinner80
heart-spinner80
hourglass-spinner80
orbitals-spinner
ouroboro-spinner
rsc-ring-spinner80
ripple-spinner80
roller-spinner
spinner-spinner

Support?

License

MIT license.