Loading States Usage Guide

Components Available

1. LoadingSpinner

Simple spinner for quick loads

import { LoadingSpinner } from '../shared/LoadingSpinner';

// Basic usage
<LoadingSpinner />

// With message
<LoadingSpinner message="Loading requests..." />

// Different sizes
<LoadingSpinner size="small" />
<LoadingSpinner size="medium" />  // default
<LoadingSpinner size="large" />

2. SkeletonLoader

Content-shaped placeholders for better UX


Integration Examples

Example 1: Fleet Dashboard

Example 2: Supplier Dashboard

Example 3: Request Tracking Page


Best Practices

When to use LoadingSpinner:

  • Quick data fetches (<2 seconds)

  • Simple UI updates

  • Button loading states

  • Modal content loading

When to use SkeletonLoader:

  • Dashboard page loads

  • List/table data fetching

  • Complex layouts

  • Better perceived performance

Loading State Pattern:


Empty States

Don't forget to handle empty data:


TODO: Add Loading States

These dashboards still need loading states:

Estimated time to add: ~15 minutes per dashboard


Testing Loading States

Force loading state in development:


Status: ✅ Components ready, integration pending

Quick Win: Add to FleetOSFleetDashboard.tsx first (most visible)

Last updated

Was this helpful?