# Indeterminate progress bar

> A slim bar with a segment that keeps sliding across, for waits when you don’t know how long they’ll take.

- Category: [Loaders](https://library.aimran.es/components/loaders)
- Built with: React + Motion
- Live editor: https://library.aimran.es/blocks/progress-bar
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

An indeterminate progress bar says “working on it” without promising a time. It fits the top edge of a web app while the next page loads, the header of a dashboard refreshing its charts or the space under the search box of a flight comparison site. It stays out of the way and still shows life.

Thin works best: three or four pixels pinned to the top of the screen are barely noticed, yet reassuring. As soon as you know the real percentage, switch to a determinate bar so people can see the end coming.

## Code

### React (Motion)

```tsx
import { motion } from "framer-motion";

interface ProgressBarProps {
  color?: string;
  /** Grosor de la barra en px. */
  size?: number;
  /** Duración de un recorrido en segundos. */
  speed?: number;
}

export default function ProgressBar({
  color = "#0071e3",
  size = 10,
  speed = 1.6,
}: ProgressBarProps) {
  return (
    <div
      role="progressbar"
      aria-label="Loading"
      className="w-56 overflow-hidden rounded-full bg-black/5 dark:bg-white/10"
      style={{ height: size }}
    >
      <motion.div
        className="h-full rounded-full"
        style={{ backgroundColor: color }}
        initial={false}
        animate={{ x: ["-100%", "220%"] }}
        transition={{ duration: speed, repeat: Infinity, ease: "easeInOut" }}
      />
    </div>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Indeterminate progress bar” block (Loaders) from AIMRAN Library to my project.

## What it is
A slim bar with a segment that keeps sliding across, for waits when you don’t know how long they’ll take.

## Chosen settings
- Color: #0071e3
- Thickness: 10px (from 4 to 24px)
- Speed: 1.6s (from 0.6 to 4s)

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with React + TypeScript, with framer-motion for the animation and lucide-react for the icons. If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import { motion } from "framer-motion";

interface ProgressBarProps {
  color?: string;
  /** Grosor de la barra en px. */
  size?: number;
  /** Duración de un recorrido en segundos. */
  speed?: number;
}

export default function ProgressBar({
  color = "#0071e3",
  size = 10,
  speed = 1.6,
}: ProgressBarProps) {
  return (
    <div
      role="progressbar"
      aria-label="Loading"
      className="w-56 overflow-hidden rounded-full bg-black/5 dark:bg-white/10"
      style={{ height: size }}
    >
      <motion.div
        className="h-full rounded-full"
        style={{ backgroundColor: color }}
        initial={false}
        animate={{ x: ["-100%", "220%"] }}
        transition={{ duration: speed, repeat: Infinity, ease: "easeInOut" }}
      />
    </div>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
