Skip to content
Pixelbits
Docs / Pixel loader
Signature

Pixel loader

Pixel loaders, CSS only, colored by currentColor with accent squares. Every animation starts mid-cycle, so a loader is already moving on its first frame. They slow down under reduced motion.

SnakeLoading a list
PulseWaiting on a reply
NoiseProcessing data

Installation

npm: import
import { PixelLoader } from "pixelbits/pixel-loader";
shadcn: copy the source
npx shadcn add https://pixelbits.ali-moradi-develop.com/r/pixel-loader.json

API

<PixelLoader>

Pixel loaders, CSS only, colored by currentColor with accent squares. Every animation starts mid-cycle, so a loader is already moving on its first frame. They slow down under reduced motion.

Example
<PixelLoader variant="pulse" size={10} label="Loading projects" />
PropTypeDefaultDescription
variant"snake" | "pulse" | "noise""snake"

Animation.

  • "snake": an accent head runs clockwise around a 3 x 3 grid with a fading tail (indeterminate work, e.g. loading a list).
  • "pulse": rings ripple out from an accent center (waiting on a reply).
  • "noise": a 12 x 2 strip flickers like static (processing data).
sizenumber6

Square size in px.

labelstring"Loading"

Accessible name (role="status").

Also accepts every prop of HTMLAttributes<HTMLSpanElement>.