Skip to main content

Components

Spinner

Option for your additional loading indicator

banner-Spinner
Square Icon

Selected Theme

Select brand or tribe name to preview style

Default

Usage

A spinner component to display a loading state of a page or section.

import { Spinner } from 'legion-ui';

Basic

Default usage of Spinner and its behavior being md in size and primary in variants.

Loading...
<Spinner />

Inside a Container

Spinning inside a centered container.

Loading...
<div className="flex justify-center items-center">
<Spinner />
</div>

Size

You can customise the size of the Spinner via the size prop, which accepts either sm, md, or lg. By default size is md.

Loading...
Loading...
Loading...
<Spinner size="sm" />
<Spinner size="md" />
<Spinner size="lg" />

Variants

The spinner has two available variants: primary and secondary. By default it is using the primary value.

Loading...
Loading...
<Spinner size="lg" variant="primary" />
<Spinner size="md" variant="secondary" />

Props

propertypropTyperequireddefaultdescription
sizesm | md | lg-mdSet the size of the spinner
styleobject--The style prop lets you style elements inline
variantprimary | secondary-primarySet the color/them value of the spinner