Left Liquid Background
Right Liquid Background

Spinner

Spinners indicate loading or ongoing processes, keeping users informed while the system completes background tasks.

Installation

Install the spinner individually or as part of the complete @aristobyte-ui library.

Installation of Spinner

The above command installs the Spinner component individually. You may skip this step if @aristobyte-ui is already installed globally.

Package Manager

Individual Package

Install only the spinner if you need specific functionality.

Full Library

Skip this if you have the complete @aristobyte-ui already installed.

Import

Choose between individual package imports or global library imports based on your project's needs and bundle size requirements.

Import Spinner

The Spinner component provides visual feedback for asynchronous actions, improving user awareness of system state. Import it as shown below to seamlessly integrate it into loading workflows:

Import Method

;

Individual Package

Import directly from the spinner package for optimal tree-shaking and smaller bundle sizes.

Recommended for component-specific usage

Global Library

Import from the main library package when using multiple components from AristoByte UI.

Recommended for component-specific usage

Basic Usage Example

Basic implementation of the component using default properties. Suitable for general-purpose interactions.

Spinner Variants

Spinners can adopt different colors (e.g., default, primary, secondary, success, warning, error) to reflect status or brand semantics during loading phases.

Preview

Guidelines

    Semantic Mapping
  • Map variant color to the underlying operation's intent.

  • Use neutral variants for generic background loading.

  • Avoid color semantics that conflict with surrounding alerts or messages.

  • Document variant palette so consumers can choose consistent intent across components.

    Best Practices
  • Maintain contrast against the host surface.

  • Avoid red unless signaling error-state recovery.

  • Provide tokenized color fallbacks for consumer themes that override core palettes.

  • Test spinner visibility across density and scale settings in OS accessibility panels.

Spinner Sizes

The Spinner component supports five predefined sizes — xsm, sm, md, lg, and xlg — enabling consistent integration across interface hierarchies. From inline loaders to full-screen indicators, choose the size that best fits the UI context.

Preview

Guidelines

    When to Use
  • Use smaller sizes inline with text or icons.

  • Use large/x-large for blocking overlays or empty states.

  • Prefer size tokens aligned to component density metrics to ensure cohesive scaling.

  • Use larger spinners for empty-state placeholders to center user attention.

    Implementation Notes
  • Keep spinner size proportional to containing control.

  • Avoid oversized loaders that shift layout.

  • Expose size props rather than hard-coded CSS so consumers can adapt programmatically.

  • Validate spinner sizing on retina and high-DPI displays to prevent pixelation.

Spinner Types

AristoByte UI offers five spinner types — default, duo, gradient, pulse, and pulse-duo. Each type provides a distinct animation style suited for different loading scenarios, from inline feedback to full-screen blocking loaders.

Preview

Guidelines

    When to Use
  • Use simple types for inline indicators; complex for standalone loaders.

  • Prefer non-blocking spinners within content regions.

  • Choose duo/gradient types for brand-centric hero loaders where motion complements identity.

  • Use pulse types sparingly in high-density pages to avoid visual fatigue.

    Performance Considerations
  • Avoid overly decorative types in enterprise workflows.

  • Ensure animation performance stays under 60fps budget.

  • Fallback to static indicators in reduced-motion user settings.

  • Keep DOM footprint minimal for spinner variants used frequently in lists.

Props Reference

Complete reference for all props available on Spinner component(s), including type definitions, default values, and usage examples.

  • Spinner

    • Visual Props
      • type

        'default' | 'duo' | 'gradient' | 'pulse' | 'pulse-duo'default: 'default'

      • variant

        'default' | 'primary' | 'secondary' | 'success' | 'error' | 'warning'default: 'default'

      • size

        'xsm' | 'sm' | 'md' | 'lg' | 'xlg'default: 'md'

    • Advanced Props
      • className

        stringdefault: ''

      • style

        React.CSSPropertiesdefault: {}

Viewing Unit with ID spinner