---
title: "Loader"
description: "Loading indicator with seventeen variants: spinner, dots, bars, dot-matrix, dither, morph, comet, scramble, metaballs, newton, helix, percent, and five terminal-style ascii spinners. Scales from one size prop, uses currentColor, and reduced-motion swaps every transform for a calm opacity pulse."
category: "Components"
publishedAt: "2026-07-04"
updatedAt: "2026-11-10"
documentation: "https://beui.dev/components/motion/loader"
markdown: "https://beui.dev/components/motion/loader.md"
license: "MIT"
---

# Loader

> Loading indicator with seventeen variants: spinner, dots, bars, dot-matrix, dither, morph, comet, scramble, metaballs, newton, helix, percent, and five terminal-style ascii spinners. Scales from one size prop, uses currentColor, and reduced-motion swaps every transform for a calm opacity pulse.

## Install

```bash
npx shadcn@latest add @beui/loader
```

## Dependencies

- `clsx`
- `motion`
- `react`
- `tailwind-merge`

## Usage

```tsx
"use client";

import { Loader, type LoaderVariant } from "@/components/motion/loader";

const VARIANTS: { variant: LoaderVariant; label: string }[] = [
  { variant: "spinner", label: "Spinner" },
  { variant: "dots", label: "Dots" },
  { variant: "bars", label: "Bars" },
  { variant: "dot-matrix", label: "Dot Matrix" },
  { variant: "dither", label: "Dither" },
  { variant: "morph", label: "Morph" },
  { variant: "comet", label: "Comet" },
  { variant: "metaballs", label: "Metaballs" },
  { variant: "newton", label: "Newton" },
  { variant: "helix", label: "Helix" },
  { variant: "scramble", label: "Scramble" },
  { variant: "percent", label: "Percent" },
  { variant: "ascii", label: "ASCII" },
  { variant: "ascii-line", label: "ASCII Line" },
  { variant: "ascii-braille", label: "ASCII Braille" },
  { variant: "ascii-blocks", label: "ASCII Blocks" },
  { variant: "ascii-bounce", label: "ASCII Bounce" },
];

export function LoaderPreview() {
  return (
    <div className="flex flex-wrap items-center justify-center gap-8 p-8">
      {VARIANTS.map(({ variant, label }) => (
        <div key={variant} className="flex flex-col items-center gap-4">
          <Loader variant={variant} size={36} />
          <span className="text-xs text-muted-foreground">{label}</span>
        </div>
      ))}
    </div>
  );
}
```

## API Reference

### Loader

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `variant` | `"metaballs" \| "dots" \| "spinner" \| "bars" \| "dot-matrix" \| "dither" \| "ascii" \| "ascii-line" \| "ascii-braille" \| "ascii-blocks" \| "ascii-bounce" \| "morph" \| "comet" \| "scramble" \| "newton" \| "helix" \| "percent"` | `spinner` | No | Which animation to render. |
| `size` | `number` | `32` | No | Base square size in px. Everything scales from this. |
| `speed` | `number` | `1` | No | Seconds per animation cycle. |
| `label` | `string` |  | No | Accessible label announced to screen readers. |
| `labels` | `Partial<{ label: string; scramble: string; }>` |  | No | Override any built-in string. |
| `className` | `string` |  | No | Classes merged onto the root element. |

## About Loader

Loader is a single React loading indicator with seventeen variants: spinner, dots, bars, dot matrix, dither, morph, comet, scramble, metaballs, newton, helix, percent, and five terminal-style ASCII spinners like the ones command line AI agents use. Every variant scales from one size prop and draws in currentColor, so it inherits text color and works in light and dark themes without extra styling.

### When to use it

- A button, table or card needs an inline spinner that matches the surrounding text color.
- An AI chat or terminal-style interface wants an ASCII or braille spinner instead of a generic circle.
- A full-page or section loading state needs something more distinctive than a default spinner, such as metaballs or a dot matrix.

### Accessibility

The loader renders with the status role and takes a label prop that screen readers announce, such as "Loading results". With reduced motion enabled, every variant replaces its movement with a calm opacity pulse, so it still signals activity without spinning or bouncing.

### FAQ

**How do I change the color of the loading spinner?**

Set a text color on the loader or its parent, for example with a Tailwind text class. Every variant paints with currentColor.

**How do I make the spinner bigger or faster?**

Use the size prop for pixel size and the speed prop for the length of one animation cycle in seconds. Lower speed values spin faster.

**Does the loader need extra dependencies?**

Only Framer Motion (the motion package), which the rest of beUI also uses. The ASCII variants are plain text frames, so they need no fonts or images.

## React Native

A React Native version ships in beUI Native. The detail JSON has every file to copy.

```bash
npx expo install react-native-reanimated react-native-worklets
npm install uniwind tailwindcss
```

- Native detail: https://beui.dev/native/r/loader
- GitHub: https://github.com/starc007/beui-native/tree/main/src/components/loader

## Source

- Registry detail: https://beui.dev/r/loader
- Raw source: https://beui.dev/r/loader/raw
- GitHub: https://github.com/starc007/ui-components
