@zendeskgarden/react-loaders package provides components for representing loading and progress states. All components require a ThemeProvider at the root of your application.
Installation
Skeleton
A placeholder that mimics the shape of content while it loads. UseSkeleton to reduce perceived load time and prevent layout shift.
Usage
Skeleton props
Sets the width as a percentage of the parent element’s width. For example,
'75%'.Sets the height as a percentage of the parent element’s height when height is not already inherited from
line-height.Inverts the skeleton color for use on dark backgrounds.
Spinner
An animated circular indicator for indeterminate loading states. UseSpinner when an operation is in progress and the duration is unknown.
Usage
Spinner props
Sets the height and width of the spinner in pixels. Inherits the parent element’s font size by default.
Sets the fill color. Accepts a Garden color variable key (for example,
'foreground.primary') or any hex value. Inherits the parent’s color by default.Sets the length of one animation cycle in milliseconds.
Delays rendering the spinner to avoid a flash during fast load times. Useful when the loading state may resolve quickly.
Dots
An animated three-dot indicator for indeterminate loading states. UseDots as a compact alternative to Spinner, particularly inside buttons or inline text.
Usage
Dots props
Sets the height and width of the dots in pixels. Inherits the parent element’s font size by default.
Sets the fill color. Accepts a Garden color variable key (for example,
'foreground.primary') or any hex value. Inherits the parent’s color by default.Sets the length of one animation cycle in milliseconds.
Delays rendering the dots to avoid a flash during fast load times.
Inline
A compact animated loader sized to fit inline with text content. UseInline when you need a loader that visually integrates into a line of text or a small container.
Usage
Inline props
Sets the width in pixels and scales the loader height proportionally.
Sets the fill color. Accepts a Garden color variable key (for example,
'foreground.primary') or any hex value. Inherits the parent’s color by default.Progress
A determinate horizontal bar for communicating measurable progress. UseProgress when you know the percentage of a task that has been completed.
Usage
Controlled progress
Progress props
The current progress as a number between
0 and 100.Adjusts the height of the progress bar. Accepts
'small', 'medium', or 'large'.Sets the foreground bar’s fill color. Accepts a Garden color variable key (for example,
'border.primaryEmphasis') or any hex value. Defaults to the border.successEmphasis theme value.