Loading Indicator

View in Lexicon

The loading indicator shows the user that an external process, like a connection, is being executed.

installyarn add @clayui/loading-indicator
versionNPM Version
useimport LoadingIndicator from '@clayui/loading-indicator';

Shapes

The loading indicator takes on the currentColor and font-size by default.

Circle

The circle indicator is the default shape of the loading indicator. It should be used with small components such as badges, buttons, inputs, tables rows, etc.

It should be used with size xs and sm. The displayType should be secondary or light.

Squares

The squares indicator uses 2 square shapes taken from the Liferay logo. It helps us include some details from the brand in our product interfaces. It should be used only for bigger components such as cards, modals, sidebars, dashboards, etc. Enable the squares indicator by setting the property shape to squares.

It should be used with size md and lg. The displayType should be primary or light.

Display Types

The loading indicator uses the currentColor by default. You can force the state/color on the loading indicator by passing one of the three variants, primary, secondary, and light, to the displayType property.

Primary

Fix the color of the loading indicator to be the primary color by setting the displayType to primary.

Secondary

Fix the color of the loading indicator to be the secondary color by setting the displayType to secondary.

Light

Fix the color of the loading indicator to be the light color by setting the displayType to light. It allows the indicator to be more accessible in some cases.

Sizes

The loading indicator ships with four sizes, xs, sm, md, and lg. It inherits the parent’s font-size by default.

Extra Small

Fix the loading indicator font-size to be 10px by setting the size property to xs.

Small

Fix the loading indicator font-size to be 16px by setting the size property to sm.

Medium

Fix the loading indicator font-size to be 32px by setting the size property to md.

Large

Fix the loading indicator font-size to be 64px by setting the size property to lg.

API Reference

LoadingIndicator

React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLSpanElement>>
Parameters
Properties

displayType

"secondary" | "primary" | "light" | null | undefined

Determines the color of the visual indicator.

shape

"circle" | "squares" | null | undefined

Determines the style of the visual indicator.

size

"sm" | "lg" | "xs" | "md" | null | undefined

Determines the size of the visual indicator.

Deprecated

light

boolean | undefined

Flag to indicate the ‘light’ variant

Deprecated

small

boolean | undefined

Flag to indicate the small size

Returns
ReactElement<any, string | JSXElementConstructor<any>> | null
Edit this page on GitHub

Contributors

Matuzalém Teles, Diego Nascimento, Bryce Osterhaus, Patrick Yeo, Krešimir Čoko

Last edited May 11, 2025 at 5:57:01 PM