Loading

Loading spinners and animation indicators

The Loading component provides multiple animated indicators to communicate that content is being loaded or an operation is in progress. v0.4 rebuilds it with 23 variants, from the classic spinner to logo, snake, wave, typing and shimmer. The animations ship inside the component, so they also work with the NuGet package, and they follow the current text colour.

Installation

bash
shellui add loading

Basic Usage

<Loading />

All variants

Variants

Spinner (Default)

A classic rotating spinner:

<Loading Variant="spinner" />

Dots

Three pulsing dots:

<Loading Variant="dots" />

Pulse

A pulsing circle:

<Loading Variant="pulse" />

Ring

An animated ring:

<Loading Variant="ring" />

Bars

Animated vertical bars:

<Loading Variant="bars" />

Grid

A pulsing grid pattern:

<Loading Variant="grid" />

Orbit

An orbiting animation:

<Loading Variant="orbit" />

The ShellUI mark, drawn dot by dot. shellui init uses the same animation in the terminal.

<div class="flex items-center gap-8">
    <Loading Variant="logo" Size="sm" />
    <Loading Variant="logo" />
    <Loading Variant="logo" Size="lg" />
</div>

Shimmer and typing

shimmer sweeps a highlight across its Text ("Loading..." by default), and typing is the three-dot indicator used in chat UIs. Label sets the name screen readers announce.

Loading... Generating a reply...
<div class="flex flex-col items-start gap-3">
    <Loading Variant="shimmer" />
    <Loading Variant="shimmer" Text="Generating a reply..." />
    <Loading Variant="typing" Label="Assistant is typing" />
</div>

Sizes

Control the loading indicator size:

<Loading Variant="spinner" Size="sm" />
<Loading Variant="spinner" Size="md" />
<Loading Variant="spinner" Size="lg" />

Full Page Loading

Overlay a loading indicator over the full viewport:

razor
@if (isLoading)
{
  <div class="fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm">
    <Loading Variant="spinner" Size="lg" />
  </div>
}

Inline Loading

Use loading indicators inline with content:

razor
<Button Disabled="@isSaving">
  @if (isSaving)
  {
    <Loading Variant="spinner" Size="sm" Class="mr-2" />
    <span>Saving...</span>
  }
  else
  {
    <span>Save</span>
  }
</Button>

@code {
    private bool isSaving = false;
}

Skeleton vs Loading

Use Skeleton for content placeholders and Loading for active operations:

@* Content placeholder *@
<Skeleton Class="h-4 w-[200px]" />

@* Active operation *@
<Loading Variant="spinner" Size="sm" />

API Reference

Property Type Default Description
Variant string "spinner" Animation style: spinner, dots, typing, wave, pulse, ring, dual-ring, ripple, bars, bars-vertical, bars-pulse, grid, snake, rows, columns, sequence, twinkle, logo, orbit, activity, chase, progress, shimmer
Size string "default" Indicator size: sm, default, lg
Label string "Loading" Accessible name announced by screen readers
Text string? null Text for the shimmer variant
Class string? null Additional CSS classes

Accessibility

The Loading component includes:

  • role="status" for screen reader announcements
  • aria-label="Loading" by default; change it with Label
  • Slows down under prefers-reduced-motion
  • Hidden from screen readers when not visible

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.