Skip to Content

Ring Loader

Ring loading spinner in variants: portal, arc, orbit, pulse and crescent, painted by default in Voice Orb's scarlet and cobalt, which you can recolor. Reduced motion swaps every spin for a slow breath.

Installation

pnpm dlx shadcn@latest add @01orbital/ring-loader

Usage

import type { CSSProperties } from "react"

import { RingLoader } from "@/components/loader/ring-loader"
import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"

// The copy: change text here, not in the markup.
const COPY = {
  title: "Ash",
  body: "Graphite on graphite, for a neutral interface. Lifted in dark mode so every ring reads.",
  ground: "Voice Orb · ash",
} as const

// The five styles in Voice Orb's ash palette: the palette in light mode,
// lifted in dark mode so every ring reads.
export default function RingLoaderDemo() {
  return (
    <Card className="relative isolate w-full max-w-[608px] min-w-0 rounded-[20px] border border-border bg-background font-sans text-foreground shadow-none ring-0 [--card-spacing:--spacing(8)] [--ring-a:oklch(0.52_0.006_90)] [--ring-b:oklch(0.44_0.006_90)] [--ring-c:oklch(0.30_0.006_270)] max-[480px]:[--card-spacing:--spacing(5.5)] dark:[--ring-a:oklch(0.74_0.006_90)] dark:[--ring-b:oklch(0.64_0.006_90)] dark:[--ring-c:oklch(0.52_0.006_270)]">
      <CardHeader className="min-w-0 gap-2">
        <CardTitle className="text-[17px]/[26px] font-medium tracking-[-0.02em]">
          {COPY.title}
        </CardTitle>
        <CardDescription className="text-xs/[22px] text-muted-foreground">
          {COPY.body}
        </CardDescription>
      </CardHeader>
      <CardContent className="grid min-w-0 grid-cols-5 gap-3.5 max-[600px]:flex max-[600px]:flex-wrap max-[600px]:justify-center max-[600px]:gap-x-3 max-[600px]:gap-y-6">
        {(["portal", "arc", "orbit", "pulse", "crescent"] as const).map(
          (form) => (
            <figure
              key={form}
              className="grid min-w-0 justify-items-center gap-4 max-[600px]:flex-[0_0_calc((100%-24px)/3)]"
            >
              <div className="grid aspect-square w-[72px] max-w-full place-items-center rounded-full">
                <RingLoader
                  variant={form}
                  size={40}
                  role="presentation"
                  aria-hidden
                  aria-label={undefined}
                  style={
                    {
                      "--ld-a": "var(--ring-a)",
                      "--ld-b": "var(--ring-b)",
                      "--ld-c": "var(--ring-c)",
                    } as CSSProperties
                  }
                />
              </div>
              <figcaption className="text-[11px]/5 text-muted-foreground capitalize">
                {form}
              </figcaption>
            </figure>
          )
        )}
      </CardContent>
      <CardFooter className="flex items-center gap-2" aria-hidden="true">
        <span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-(--ring-a)" />
        <span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-(--ring-b)" />
        <span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-(--ring-c)" />
        <p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
          {COPY.ground}
        </p>
      </CardFooter>
    </Card>
  )
}

This example installs with everything it uses:

pnpm dlx shadcn@latest add @01orbital/ring-loader-demo

Examples

Amberring-loader-amber

Ring Loader example: all five forms in amber and gold on an ink ground, each labeled, followed by a three-dot color key. Use it to pick a warm loader color for a dark interface.

pnpm dlx shadcn@latest add @01orbital/ring-loader-amber

Cloud Dancer Rosering-loader-cloud-dancer-rose

Ring Loader Cloud Dancer Rose: an example of ring-loader.

pnpm dlx shadcn@latest add @01orbital/ring-loader-cloud-dancer-rose

Cloud Dancer Tealring-loader-cloud-dancer-teal

Ring Loader Cloud Dancer Teal: an example of ring-loader.

pnpm dlx shadcn@latest add @01orbital/ring-loader-cloud-dancer-teal

Cobaltring-loader-cobalt

Ring Loader example: a row of five rings in saturated cobalt blue on a light ground, lifting to a brighter blue at the edge, each labeled. Use it to choose a blue loader for a light interface.

pnpm dlx shadcn@latest add @01orbital/ring-loader-cobalt

Coralring-loader-coral

Ring Loader example: five rings in coral and red on a light ground, with a deeper arc so each form reads clearly on paper. Use it to choose a warm loader color for a light interface.

pnpm dlx shadcn@latest add @01orbital/ring-loader-coral

Duskring-loader-dusk

Ring Loader example: all five forms in Voice Orb's dusk palette, magenta over violet, each labeled, with a three-dot color key. Use it to match a loader to a Voice Orb.

pnpm dlx shadcn@latest add @01orbital/ring-loader-dusk

Emberring-loader-ember

Ring Loader example: all five forms in Voice Orb's ember palette, amber over oxblood: warm, like a coal, each labeled, with a three-dot color key. Use it to match a loader to a Voice Orb.

pnpm dlx shadcn@latest add @01orbital/ring-loader-ember

Glacierring-loader-glacier

Ring Loader example: icy cyan and pale blue rings in all five forms on a deep blue surface, with a small color key. Use it to choose a cool loader color for a dark interface.

pnpm dlx shadcn@latest add @01orbital/ring-loader-glacier

Goldring-loader-gold

Ring Loader example: all five forms in Voice Orb's gold palette, gold over bronze, each labeled, with a three-dot color key. Use it to match a loader to a Voice Orb.

pnpm dlx shadcn@latest add @01orbital/ring-loader-gold

Light Noirring-loader-light-noir

Ring Loader Light Noir: an example of ring-loader.

pnpm dlx shadcn@latest add @01orbital/ring-loader-light-noir

Mintring-loader-mint

Ring Loader example: fresh mint green rings with a blue-green turn in all five forms on an ink ground, with a small color key. Use it to choose a green loader for a dark interface.

pnpm dlx shadcn@latest add @01orbital/ring-loader-mint

Monotone Graphitering-loader-monotone-graphite

Ring Loader Monotone Graphite: an example of ring-loader.

pnpm dlx shadcn@latest add @01orbital/ring-loader-monotone-graphite

Monotone Silverring-loader-monotone-silver

Ring Loader Monotone Silver: an example of ring-loader.

pnpm dlx shadcn@latest add @01orbital/ring-loader-monotone-silver

Loading Statering-loader-open-library

Ring Loader Loading State: an example of ring-loader.

pnpm dlx shadcn@latest add @01orbital/ring-loader-open-library

Original Dustyring-loader-original-dusty

Ring Loader Original Dusty: an example of ring-loader.

pnpm dlx shadcn@latest add @01orbital/ring-loader-original-dusty

Planet 14ring-loader-planet-14

Ring Loader example: all five forms in Voice Orb's planet-14 palette, scarlet over cobalt, Voice Orb's default colors, each labeled, with a three-dot color key. Use it to match a loader to a Voice Orb.

pnpm dlx shadcn@latest add @01orbital/ring-loader-planet-14

Preparation Queuering-loader-preparation-queue

Ring Loader Preparation Queue: an example of ring-loader.

pnpm dlx shadcn@latest add @01orbital/ring-loader-preparation-queue

Prepare Previewring-loader-prepare-preview

Ring Loader Prepare Preview: an example of ring-loader.

pnpm dlx shadcn@latest add @01orbital/ring-loader-prepare-preview

Rosering-loader-rose

Ring Loader example: all five forms in Voice Orb's rose palette, rose over plum, each labeled, with a three-dot color key. Use it to match a loader to a Voice Orb.

pnpm dlx shadcn@latest add @01orbital/ring-loader-rose

Tidering-loader-tide

Ring Loader example: all five forms in Voice Orb's tide palette, teal over deep indigo: cool and quiet, each labeled, with a three-dot color key. Use it to match a loader to a Voice Orb.

pnpm dlx shadcn@latest add @01orbital/ring-loader-tide

Umberring-loader-umber

Ring Loader example: all five forms in Voice Orb's umber palette, coral over rose, each labeled, with a three-dot color key. Use it to match a loader to a Voice Orb.

pnpm dlx shadcn@latest add @01orbital/ring-loader-umber

Violetring-loader-violet

Ring Loader example: bright violet and lilac rings, one for each of the five forms, on a plum surface with a small color key. Use it to choose a purple loader for a dark interface.

pnpm dlx shadcn@latest add @01orbital/ring-loader-violet

Viridianring-loader-viridian

Ring Loader example: all five forms in Voice Orb's viridian palette, green over shadow, each labeled, with a three-dot color key. Use it to match a loader to a Voice Orb.

pnpm dlx shadcn@latest add @01orbital/ring-loader-viridian

API reference

A small ring spinner in one of five styles, for a loading state. Colors come from the --ld-a, --ld-b and --ld-c variables, which you can override through style; the faint tracks use currentColor.

Exposes role="status" with the label "Loading"; pass aria-label to change it. With reduced motion every spin and pulse becomes a slow opacity breath.

Prop

Type

It also accepts the HTML attributes of the element it renders.

Dependencies

npm: cn. The CLI installs it for you.

Used in blocks

One block is built with Ring Loader.

Last updated on