Loader

Renders a loading indicator with three animated variants (spinner, dots, pulse) using CSS animations.

Preview/Playground

Created by
Creator
Vipin
Astro Astro
import Loader from '@astroanimate/core/Loader';

<Loader type="spinner" />

Installation

bash
npm install @astroanimate/core

Usage

---
import Loader from "@astroanimate/core/Loader";
---

<Loader type="spinner" />

Displays a default spinner loader.

Props

Prop Type Default Description
sizenumber40Size in pixels
colorstring"#3b82f6"Primary color
speednumber1Animation speed in seconds
type"spinner" | "dots" | "pulse""spinner"Loader type variant
mainClassNamestring""Additional CSS class

Use When

  • Displaying loading states during data fetching
  • Showing async operation progress
  • Indicating content is being loaded

Avoid When

  • Complex loading indicators with progress bars needed
  • Custom animation sequences required

Accessibility

  • Includes aria-label="Loading" and role="status"
  • Respects prefers-reduced-motion media query (disables animations)

Performance

  • CSS-only animations (no JavaScript overhead)
  • Minimal DOM footprint

Credits