Unkey
Components

Loading

A customizable animated loading indicator component

Loading Component

-The Loading component provides a sleek, animated loading indicator featuring three pulsating circles. It's designed to provide visual feedback during asynchronous operations or loading states in your application. +The Loading component provides a sleek, animated loading indicator featuring an 8-segment circular spinner. It's designed to provide visual feedback during asynchronous operations or loading states in your application.

Usage

import { Loading, Button } from "@unkey/ui";
 
function MyComponent() {
  return <Loading />;
}

Examples

Default

Size and Segment duration

Customization

The Loading component is highly customizable:

  • Color: Inherits the text color of its parent element through the fill-current class
  • Size: Adjustable through width and height props
  • Animation Speed: Configurable animation duration
  • Responsive: Adapts seamlessly to different container sizes

Props

PropTypeDefaultDescription
sizenumber24Sets both width and height of the loading indicator
durnumber125Animation duration in milliseconds per segment
classNamestringundefinedAdditional CSS classes to apply

The component also accepts all standard HTML attributes supported by the underlying SVG element.

Accessibility

The Loading component is built with accessibility in mind:

  • Includes appropriate ARIA attributes
  • Provides visual feedback without relying on color alone
  • Maintains good contrast ratios

Best Practices

  • Use consistent sizes within the same context
  • Place the loader in a logical location relative to the content being loaded
  • Consider using a minimum display duration to prevent flickering
  • Ensure sufficient contrast between the loader and its background

On this page