or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

ai-advanced.mddata-display.mdform-components.mdindex.mdinput-selection.mdlayout-navigation.mdloading-progress.mdmodal-overlay.mdtheming-customization.mdtiles-layout.md
tile.json

loading-progress.mddocs/

Loading & Progress Components

Essential loading states and progress indicators for communicating activity status, task completion, and user feedback during asynchronous operations.

Capabilities

Loading

General-purpose loading spinner with overlay options for indicating active loading states.

/**
 * General loading spinner component
 */
interface LoadingProps extends HTMLAttributes<HTMLDivElement> {
  /** Controls spinner animation - defaults to true */
  active?: boolean;
  /** CSS class name */
  className?: string;
  /** Accessible description of loading state - defaults to "loading" */
  description?: string;
  /** Small variant for inline use */
  small?: boolean;
  /** Render with overlay backdrop - defaults to true */
  withOverlay?: boolean;
}

Usage Examples:

import { Loading } from "@carbon/react";

// Full-page loading with overlay
<Loading description="Loading data..." />

// Small inline loading
<Loading small withOverlay={false} description="Saving..." />

// Inactive loading (stopped)
<Loading active={false} />

InlineLoading

Specialized loading component for forms and buttons with distinct states for different phases of async operations.

/**
 * Inline loading with status states
 */
interface InlineLoadingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
  /** CSS class name */
  className?: string;
  /** Descriptive text displayed alongside the loading state */
  description?: React.ReactNode;
  /** Accessible description for the loading icon */
  iconDescription?: string;
  /** Callback invoked when status becomes 'finished' after successDelay */
  onSuccess?: () => void;
  /** Current loading status - defaults to 'active' */
  status?: 'inactive' | 'active' | 'finished' | 'error';
  /** Delay in milliseconds before onSuccess is called - defaults to 1500 */
  successDelay?: number;
}

/**
 * Available status values
 */
type InlineLoadingStatus = 'inactive' | 'active' | 'finished' | 'error';

Usage Examples:

import { InlineLoading } from "@carbon/react";

// Basic form loading
<InlineLoading status="active" description="Saving changes..." />

// Success state with callback
<InlineLoading 
  status="finished" 
  description="Saved successfully"
  onSuccess={() => console.log('Save completed')}
/>

// Error state
<InlineLoading status="error" description="Failed to save" />

// Inactive state
<InlineLoading status="inactive" description="Ready to save" />

ProgressIndicator

Multi-step workflow progress tracker showing sequential steps with completion status and navigation capabilities.

/**
 * Progress indicator for multi-step workflows
 */
interface ProgressIndicatorProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {
  /** ProgressStep components */
  children?: React.ReactNode;
  /** CSS class name */
  className?: string;
  /** Current active step index - defaults to 0 */
  currentIndex?: number;
  /** Callback when step is clicked - receives step index */
  onChange?: (stepIndex: number) => void;
  /** Equal spacing for all steps */
  spaceEqually?: boolean;
  /** Vertical layout orientation */
  vertical?: boolean;
}

/**
 * Individual progress step configuration
 */
interface ProgressStepProps {
  /** CSS class name */
  className?: string;
  /** Step is completed */
  complete?: boolean;
  /** Step is currently active */
  current?: boolean;
  /** Step description for accessibility */
  description?: string;
  /** Step is disabled */
  disabled?: boolean;
  /** Step index (set automatically) */
  index?: number;
  /** Step has error state */
  invalid?: boolean;
  /** Step display label - required */
  label: string;
  /** Click handler for step navigation */
  onClick?: (event: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>) => void;
  /** Optional secondary label */
  secondaryLabel?: string;
  /** Translation function for internationalization */
  translateWithId?: (messageId: string) => string;
}

/**
 * Progress indicator skeleton for loading states
 */
interface ProgressIndicatorSkeletonProps {
  /** CSS class name */
  className?: string;
  /** Vertical layout orientation */
  vertical?: boolean;
}

Usage Examples:

import { ProgressIndicator, ProgressStep } from "@carbon/react";

// Basic multi-step workflow
<ProgressIndicator currentIndex={1} onChange={(index) => setStep(index)}>
  <ProgressStep label="Account Setup" description="Create your account" />
  <ProgressStep label="Profile Info" description="Add personal details" />
  <ProgressStep label="Verification" description="Verify your email" />
  <ProgressStep label="Complete" description="Setup finished" />
</ProgressIndicator>

// Vertical layout with secondary labels
<ProgressIndicator vertical currentIndex={0}>
  <ProgressStep 
    label="Planning" 
    secondaryLabel="Define requirements"
    complete={false}
  />
  <ProgressStep 
    label="Development" 
    secondaryLabel="Build features"
    disabled
  />
</ProgressIndicator>

// Loading state
<ProgressIndicatorSkeleton />

ProgressBar

Linear progress indicator for single tasks showing percentage completion with status variants.

/**
 * Linear progress bar for task completion
 */
interface ProgressBarProps {
  /** CSS class name */
  className?: string;
  /** Descriptive text for current progress */
  helperText?: string;
  /** Visually hide the label (keeps it accessible) */
  hideLabel?: boolean;
  /** Progress bar label - required */
  label: string;
  /** Maximum value - defaults to 100 */
  max?: number;
  /** Visual size variant - defaults to 'big' */
  size?: 'small' | 'big';
  /** Progress status - defaults to 'active' */
  status?: 'active' | 'finished' | 'error';
  /** Layout alignment variant - defaults to 'default' */
  type?: 'default' | 'inline' | 'indented';
  /** Current progress value (0 to max) */
  value?: number;
}

Usage Examples:

import { ProgressBar } from "@carbon/react";

// File upload progress
<ProgressBar 
  label="Uploading document"
  value={45}
  max={100}
  helperText="45% complete"
/>

// Indeterminate progress (no value)
<ProgressBar 
  label="Processing data"
  helperText="Please wait..."
/>

// Finished state
<ProgressBar 
  label="Upload complete"
  status="finished"
  helperText="File uploaded successfully"
/>

// Error state
<ProgressBar 
  label="Upload failed"
  status="error"
  helperText="Please try again"
/>

// Small inline variant
<ProgressBar 
  size="small"
  type="inline"
  label="Saving"
  value={75}
/>

Skeleton Loading System

Carbon provides skeleton components for common loading states while data is being fetched.

ProgressIndicatorSkeleton

import { ProgressIndicatorSkeleton } from "@carbon/react";

// Basic skeleton
<ProgressIndicatorSkeleton />

// Vertical skeleton
<ProgressIndicatorSkeleton vertical />

Common Skeleton Patterns

import { 
  ButtonSkeleton,
  TextInputSkeleton,
  DropdownSkeleton,
  DataTableSkeleton 
} from "@carbon/react";

// Form skeleton
<>
  <TextInputSkeleton />
  <DropdownSkeleton />
  <ButtonSkeleton />
</>

// Table skeleton
<DataTableSkeleton 
  columnCount={4}
  rowCount={5}
  headers={['Name', 'Status', 'Date', 'Actions']}
/>

Component Selection Guide

When to Use Loading

  • Full-page loading: Initial app/page load
  • Modal overlays: Blocking operations
  • Large content areas: Section-level loading

When to Use InlineLoading

  • Form submissions: Save/submit buttons
  • Inline actions: Edit, delete, update operations
  • Status feedback: Success, error states
  • Button loading states: Action confirmation

When to Use ProgressIndicator

  • Multi-step workflows: Setup wizards, checkout flows
  • Sequential processes: Application forms
  • Navigation between steps: User can jump between completed steps

When to Use ProgressBar

  • Single task progress: File uploads, downloads
  • Percentage tracking: Processing completion
  • Time-based operations: Export generation, data processing
  • Bulk operations: Multiple item updates

Best Practices

  1. Loading States: Always provide loading feedback for operations over 200ms
  2. Progress Indication: Use specific progress (ProgressBar) when duration is known, indeterminate (Loading) when unknown
  3. Status Communication: Combine loading with descriptive text using description or helperText
  4. Accessibility: Ensure loading states are announced to screen readers with proper aria-live regions
  5. Error Handling: Always provide error states and recovery options
  6. Success Feedback: Show completion status before transitioning to new states