Loading

Versatile loading indicator with multiple variants for showing progress or waiting states

Setup

import { Loading } from '@fragments-sdk/ui';

Examples

Default

Default spinner loading indicator

Loading preview...

Sizes

Loading indicators in different sizes

Loading preview...

Dots

Bouncing dots animation

Loading preview...

Pulse

Pulsing circle animation

Loading preview...

Colors

Different color variants

Loading preview...

Inline

Inline loading indicator that flows with text

Loading preview...

Centered

Centered in container

Loading preview...

Screen

Full-screen loading state with optional label

Loading preview...

Props

PropTypeDefaultDescription
sizeenumsmmdlgxlmdSize of the loading indicator
variantenumspinnerdotspulsespinnerVisual style of the loading animation
labelstringLoading...Accessible label for screen readers
centeredbooleanfalseWhether to center the loading indicator in its container
fillbooleanfalseWhether to fill the parent container
overlaybooleanfalseWhether to show with a backdrop overlay
colorenumaccentcurrentmutedaccentColor variant - accent uses theme color, current inherits text color

Usage Guidelines

When to use

  • Indicating content is being fetched or processed
  • Showing a pending state while waiting for an async operation
  • Displaying loading state for buttons, forms, or page sections
  • Full-screen loading during initial app/page load

When not to use

  • For showing determinate progress - use Progress component instead
  • For showing skeleton placeholders - use Skeleton component instead
  • For AI-specific thinking states - use ThinkingIndicator instead

Best practices

  • Use spinner variant for general loading states
  • Use dots variant for chat/messaging contexts
  • Use pulse variant for subtle, ambient loading
  • Always provide a meaningful label for screen readers
  • Consider using Loading.Screen for initial page loads
  • Use Loading.Inline when loading indicator should flow with text
Accessibility
  • Component uses role="status" and aria-live="polite"
  • Always provide descriptive label prop for screen readers
  • Animations respect prefers-reduced-motion preference