# Orbit Loader

> Calm, planetary loading state.

- Category: Loaders
- Tier: Free (MIT)
- Page: https://bowls.dev/components/orbit-loader
- Requires: React 18+, Tailwind CSS 4

## Install

Copy the source below into `components/bowls/orbit-loader.tsx`.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `number` | `140` | Diameter in px. |
| `color` | `string` | `"currentColor"` | Planet colour (inherits text colour). |
| `label` | `string` | `"Loading"` | Announced to screen readers. |

## Usage

```tsx
import { OrbitLoader } from "@/components/bowls/orbit-loader";

export default function Demo() {
  return (
    <div className="flex h-full w-full items-center justify-center text-[#0a0a0a] dark:text-[#f5f5f5]">
      <OrbitLoader />
    </div>
  );
}
```

## Source

`components/bowls/orbit-loader.tsx`

```tsx
export type OrbitLoaderProps = {
  /** Diameter in px. */
  size?: number;
  color?: string;
  track?: string;
  label?: string;
};

/** A calm, planetary loading state. */
/** Colours default to the text colour, so it follows light / dark mode. */
export function OrbitLoader({ size = 140, color = "currentColor", track = "currentColor", label = "Loading" }: OrbitLoaderProps) {
  const r = size / 2 - 9;
  return (
    <span role="status" aria-label={label} className="relative inline-flex items-center justify-center" style={{ width: size, height: size }}>
      <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} className="absolute animate-spin" style={{ animationDuration: "6s" }} aria-hidden="true">
        <circle cx={size / 2} cy={size / 2} r={r} fill="none" stroke={track} strokeOpacity={track === "currentColor" ? 0.2 : 1} strokeWidth={1.5} />
        <circle cx={size / 2 + r} cy={size / 2} r={8} fill={color} />
      </svg>
      <svg width={size * 0.55} height={size * 0.55} viewBox="0 0 100 100" className="absolute animate-spin" style={{ animationDuration: "3s", animationDirection: "reverse" }} aria-hidden="true">
        <circle cx="50" cy="50" r="44" fill="none" stroke={track} strokeOpacity={track === "currentColor" ? 0.3 : 1} strokeWidth={2} strokeDasharray="3 7" />
        <circle cx="50" cy="6" r="6" fill={color} />
      </svg>
      <span className="size-5 rounded-full" style={{ background: color }} />
    </span>
  );
}
```
