GitHub

spinner

CSS-animated loading ring. No JavaScript required. Use to indicate background activity — inside buttons, next to labels, or as a full-area overlay.

Sizes

spinner({ size: 'sm' })
spinner({ size: 'md' })
spinner({ size: 'lg' })

Colours

spinner({ color: 'accent' })
spinner({ color: 'muted'  })
spinner({ color: 'white'  })

Inside a button

Pair with a button() to show loading state. Pass the spinner as the button's icon prop.

button({
  label:    'Saving',
  icon:     spinner({ size: 'sm', color: 'white' }),
  disabled: state.loading,
})
PropTypeDefault
sizesm | md | lgmd1rem / 1.5rem / 2.5rem
coloraccent | muted | whiteaccent
labelstringLoading…Sets aria-label on the role="status" element
classstring