# Loader

The Zenos animated SVG progress mark.

The Zenos animated SVG progress mark.

```tsx
import { Loader, Stack } from "@zentara-co/zenos-ui";

function LoaderExample() {
  return (
    <Stack direction="row" gap="8" align="center" wrap="wrap">
      <Loader variant="cross-expand" aria-label="Loading projects" />
      <Loader variant="diagonal-scan" aria-label="Scanning projects" />
      <Loader variant="orbit" aria-label="Loading activity" />
    </Stack>
  );
}
```

## Import

```tsx
import { Loader } from "@zentara-co/zenos-ui";
```

## Variants

All variants share the same 5×5 SVG grid and use per-dot timing maps. They inherit `currentColor`, require no runtime animation dependency, and settle into a calm static pattern when reduced motion is enabled.

```tsx
import { Grid, Loader, Stack, Text } from "@zentara-co/zenos-ui";

function LoaderVariantsExample() {
  const variants = [
    ["cross-expand", "Cross Expand"],
    ["diagonal-scan", "Diagonal Scan"],
    ["column-scan", "Column Scan"],
    ["orbit", "Orbit"],
    ["scan-line", "Scan Line"],
    ["cipher", "Cipher"],
    ["pendulum", "Pendulum"],
    ["aperture", "Aperture"],
    ["static", "Static"],
  ] as const;

  return (
    <Grid columns={{ base: 2, md: 3 }} gap="6" className="w-full">
      {variants.map(([variant, label]) => (
        <Stack key={variant} gap="2" align="center">
          <Loader variant={variant} aria-label={`${label} loading`} />
          <Text size="s" color="subtle">
            {label}
          </Text>
          <code className="text-xs text-text-subtlest">{variant}</code>
        </Stack>
      ))}
    </Grid>
  );
}
```

Use the `variant` prop with semantic names: `cross-expand` (default), `diagonal-scan`, `column-scan`, `orbit`, `scan-line`, `cipher`, `pendulum`, `aperture`, and `static`. Several patterns are adapted from the MIT-licensed [dot/matrix animation set](https://dot-matrix-animations.vercel.app/).

```tsx
<Loader variant="diagonal-scan" aria-label="Scanning workspace" />
<Loader variant="cipher" aria-label="Decrypting export" />
```

## Size and color

Loader uses `currentColor`, so semantic text utilities control its tone. Its default size is 56px; use `className` for contextual sizing without changing the SVG view box.

```tsx
<Loader className="size-6 text-text-subtle" aria-label="Saving" />
<Loader className="size-10 text-primary" aria-label="Loading report" />
```

## Variants

cross-expand, diagonal-scan, column-scan, orbit, scan-line, cipher, pendulum, aperture, static

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | LoaderVariant | cross-expand | Dot-matrix animation pattern. |
| aria-label | string | Loading | Accessible name and SVG title for the current operation. |
| native props | React.SVGProps<SVGSVGElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

## Accessibility

Loader exposes an SVG image with a title derived from `aria-label`. Name the operation rather than the graphic—for example, “Saving changes” instead of “Animated dots.” For frequently updating status text, place Loader beside a separate live region; the animation itself does not announce progress. Every variant respects `prefers-reduced-motion`.

Source: https://zenos-ui.pages.dev/components/loader/