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.
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
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>
)
}
Installation
pnpm dlx shadcn@latest add @01orbital/ring-loadernpx shadcn@latest add @01orbital/ring-loaderyarn dlx shadcn@latest add @01orbital/ring-loaderbunx --bun shadcn@latest add @01orbital/ring-loaderUsage
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-demonpx shadcn@latest add @01orbital/ring-loader-demoyarn dlx shadcn@latest add @01orbital/ring-loader-demobunx --bun shadcn@latest add @01orbital/ring-loader-demoExamples
Fare Searchring-loader-fare-search
Search loading card example showing the RingLoader: a train fare search card with a route header and an orbit ring beside a fare-checking note.
import { RingLoader } from "@/components/loader/ring-loader"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { Separator } from "@/components/ui/separator"
// The copy: change text here, not in the markup.
const COPY = {
brand: "seatline",
ticket: "SINGLE · 1 ADULT",
fromLabel: "FROM",
fromCity: "London",
fromStation: "King’s Cross",
toLabel: "TO",
toCity: "York",
toStation: "York station",
when: "Friday 6 November · Depart after 09:00",
ringLabel: "Checking direct train fares from London to York",
status: "Checking direct trains",
statusNote: "Comparing Advance and Off-Peak tickets.",
footnote: "Railcard: none · No booking fee",
} as const
/** A train fare search card with a route header and an orbit Ring Loader beside a fare-checking note. */
export default function RingLoaderFareSearch() {
return (
<Card className="w-full max-w-lg rounded-xl bg-[oklch(0.97_0.012_230)] text-[oklch(0.27_0.055_240)] shadow-none ring-0 [--card-spacing:--spacing(6)]">
<CardHeader className="flex items-center justify-between">
<span className="text-lg font-bold tracking-tight">{COPY.brand}</span>
<span className="text-xs">{COPY.ticket}</span>
</CardHeader>
<Separator className="mx-(--card-spacing) bg-current/20 data-horizontal:w-auto" />
<CardContent>
<div className="grid grid-cols-[1fr_auto_1fr] items-center gap-3">
<div>
<p className="text-xs">{COPY.fromLabel}</p>
<CardTitle className="mt-1 text-xl font-semibold">
{COPY.fromCity}
</CardTitle>
<p className="text-xs/5">{COPY.fromStation}</p>
</div>
<span aria-hidden="true">→</span>
<div className="text-right">
<p className="text-xs">{COPY.toLabel}</p>
<p className="mt-1 text-xl font-semibold">{COPY.toCity}</p>
<p className="text-xs/5">{COPY.toStation}</p>
</div>
</div>
<p className="mt-4 text-sm">{COPY.when}</p>
<Card className="mt-7 rounded-lg bg-[oklch(0.9_0.035_230)] shadow-none ring-0 [--card-spacing:--spacing(5)]">
<CardContent className="flex items-center gap-4">
<RingLoader
variant="orbit"
size={36}
className="shrink-0"
aria-label={COPY.ringLabel}
style={
{
"--ld-a": "oklch(0.5 0.13 240)",
"--ld-b": "oklch(0.48 0.12 235)",
"--ld-c": "oklch(0.6 0.08 200)",
} as React.CSSProperties
}
/>
<div>
<CardTitle className="text-sm font-semibold">
{COPY.status}
</CardTitle>
<CardDescription className="mt-1 text-xs/5 text-current">
{COPY.statusNote}
</CardDescription>
</div>
</CardContent>
</Card>
</CardContent>
<CardFooter className="text-xs/5">{COPY.footnote}</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-fare-searchnpx shadcn@latest add @01orbital/ring-loader-fare-searchyarn dlx shadcn@latest add @01orbital/ring-loader-fare-searchbunx --bun shadcn@latest add @01orbital/ring-loader-fare-searchAmberring-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.
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: "Amber",
body: "Clear amber and gold light on ink, without a dark brown stop.",
ground: "Dark ground",
} as const
/** Amber and gold Ring Loaders in all five forms on an ink ground, labeled and followed by a three-dot color key. */
export default function RingLoaderAmber() {
return (
<Card className="dark 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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.65 0.18 65)",
"--ld-b": "oklch(0.88 0.15 85)",
"--ld-c": "oklch(0.76 0.17 75)",
} 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-[oklch(0.65_0.18_65)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.88_0.15_85)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.76_0.17_75)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-ambernpx shadcn@latest add @01orbital/ring-loader-amberyarn dlx shadcn@latest add @01orbital/ring-loader-amberbunx --bun shadcn@latest add @01orbital/ring-loader-amberCloud Dancer Rosering-loader-cloud-dancer-rose
Ring Loader Cloud Dancer Rose: an example of ring-loader.
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: "Cloud Dancer / Rose",
body: "Warm pearl with rose ink; the material carries the soft rose shading.",
ground: "Pearl surface",
} as const
/** All five Ring Loader forms in rose ink on pearl wells over warm paper, from portal and arc to orbit, pulse and crescent. */
export default function RingLoaderCloudDancerRose() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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 border border-[oklch(0.22_0.008_60/0.12)] bg-[radial-gradient(circle_at_35%_35%,#ffffff_0%,oklch(0.995_0.002_90)_40%,oklch(0.915_0.006_85)_100%)] shadow-[inset_-2px_-3px_5px_rgb(196_112_112_/_0.28),inset_-1px_-1px_3px_rgb(196_112_112_/_0.15),inset_1.5px_2px_3px_rgb(255_255_255_/_0.85),inset_1px_1px_2px_rgb(255_255_255_/_0.6),inset_-3px_-3px_6px_rgb(90_144_144_/_0.1),0_1.5px_4px_rgb(196_112_112_/_0.18),0_1px_2px_rgb(0_0_0_/_0.06)]">
<RingLoader
variant={form}
size={40}
role="presentation"
aria-hidden
aria-label={undefined}
style={
{
"--ld-a": "oklch(0.76 0.035 20)",
"--ld-b": "oklch(0.46 0.10 20)",
"--ld-c": "oklch(0.90 0.006 85)",
} 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-[oklch(0.76_0.035_20)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.46_0.10_20)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.90_0.006_85)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-cloud-dancer-rosenpx shadcn@latest add @01orbital/ring-loader-cloud-dancer-roseyarn dlx shadcn@latest add @01orbital/ring-loader-cloud-dancer-rosebunx --bun shadcn@latest add @01orbital/ring-loader-cloud-dancer-roseCloud Dancer Tealring-loader-cloud-dancer-teal
Ring Loader Cloud Dancer Teal: an example of ring-loader.
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: "Cloud Dancer / Teal",
body: "Warm pearl and clear teal ink, with the tint kept in one cool family.",
ground: "Pearl surface",
} as const
/** The five Ring Loader forms drawn in clear teal ink on pearl wells over warm paper, each labeled beneath its ring. */
export default function RingLoaderCloudDancerTeal() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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 border border-[oklch(0.22_0.008_60/0.12)] bg-[radial-gradient(circle_at_35%_35%,#ffffff_0%,oklch(0.995_0.002_90)_40%,oklch(0.915_0.006_85)_100%)] shadow-[inset_-2px_-3px_5px_rgb(196_112_112_/_0.28),inset_-1px_-1px_3px_rgb(196_112_112_/_0.15),inset_1.5px_2px_3px_rgb(255_255_255_/_0.85),inset_1px_1px_2px_rgb(255_255_255_/_0.6),inset_-3px_-3px_6px_rgb(90_144_144_/_0.1),0_1.5px_4px_rgb(196_112_112_/_0.18),0_1px_2px_rgb(0_0_0_/_0.06)]">
<RingLoader
variant={form}
size={40}
role="presentation"
aria-hidden
aria-label={undefined}
style={
{
"--ld-a": "oklch(0.72 0.055 185)",
"--ld-b": "oklch(0.43 0.07 190)",
"--ld-c": "oklch(0.90 0.006 85)",
} 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-[oklch(0.72_0.055_185)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.43_0.07_190)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.90_0.006_85)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-cloud-dancer-tealnpx shadcn@latest add @01orbital/ring-loader-cloud-dancer-tealyarn dlx shadcn@latest add @01orbital/ring-loader-cloud-dancer-tealbunx --bun shadcn@latest add @01orbital/ring-loader-cloud-dancer-tealCobaltring-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.
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: "Cobalt",
body: "Saturated blue ink, lifted toward a brighter blue at the edge.",
ground: "Light ground",
} as const
/** A row of five Ring Loaders in saturated cobalt blue on paper, lifting toward a brighter blue at the edge. */
export default function RingLoaderCobalt() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.40 0.18 260)",
"--ld-b": "oklch(0.52 0.20 260)",
"--ld-c": "oklch(0.68 0.16 250)",
} 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-[oklch(0.40_0.18_260)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.52_0.20_260)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.68_0.16_250)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-cobaltnpx shadcn@latest add @01orbital/ring-loader-cobaltyarn dlx shadcn@latest add @01orbital/ring-loader-cobaltbunx --bun shadcn@latest add @01orbital/ring-loader-cobaltCoralring-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.
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: "Coral",
body: "Clean coral and red ink, with a deeper arc for the light surface.",
ground: "Light ground",
} as const
/** Coral and red Ring Loaders in five forms on paper, with a deeper arc so each ring reads clearly on the light ground. */
export default function RingLoaderCoral() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.54 0.18 25)",
"--ld-b": "oklch(0.47 0.17 20)",
"--ld-c": "oklch(0.68 0.15 30)",
} 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-[oklch(0.54_0.18_25)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.47_0.17_20)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.68_0.15_30)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-coralnpx shadcn@latest add @01orbital/ring-loader-coralyarn dlx shadcn@latest add @01orbital/ring-loader-coralbunx --bun shadcn@latest add @01orbital/ring-loader-coralDuskring-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.
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: "Dusk",
body: "Magenta over violet.",
ground: "Voice Orb · dusk",
} as const
/** The five Ring Loaders in Voice Orb's dusk palette (magenta over violet), each labeled, with a three-dot color key. */
export default function RingLoaderDusk() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.60 0.16 350)",
"--ld-b": "oklch(0.52 0.15 345)",
"--ld-c": "oklch(0.34 0.11 300)",
} 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-[oklch(0.60_0.16_350)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.52_0.15_345)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.34_0.11_300)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-dusknpx shadcn@latest add @01orbital/ring-loader-duskyarn dlx shadcn@latest add @01orbital/ring-loader-duskbunx --bun shadcn@latest add @01orbital/ring-loader-duskEmberring-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.
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: "Ember",
body: "Amber over oxblood: warm, like a coal.",
ground: "Voice Orb · ember",
} as const
/** The five Ring Loaders in Voice Orb's ember palette (amber over oxblood: warm, like a coal), each labeled, with a three-dot color key. */
export default function RingLoaderEmber() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.68 0.17 55)",
"--ld-b": "oklch(0.60 0.17 45)",
"--ld-c": "oklch(0.36 0.13 30)",
} 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-[oklch(0.68_0.17_55)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.60_0.17_45)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.36_0.13_30)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-embernpx shadcn@latest add @01orbital/ring-loader-emberyarn dlx shadcn@latest add @01orbital/ring-loader-emberbunx --bun shadcn@latest add @01orbital/ring-loader-emberGlacierring-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.
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: "Glacier",
body: "Icy cyan and blue light on a deep blue surface.",
ground: "Dark ground",
} as const
/** Icy cyan and pale blue Ring Loaders across all five forms, set on a deep blue surface with a small color key. */
export default function RingLoaderGlacier() {
return (
<div className="dark flex w-full justify-center">
<Card className="theme-blue 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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.64 0.10 225)",
"--ld-b": "oklch(0.88 0.06 225)",
"--ld-c": "oklch(0.76 0.10 220)",
} 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-[oklch(0.64_0.10_225)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.88_0.06_225)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.76_0.10_220)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
</div>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-glaciernpx shadcn@latest add @01orbital/ring-loader-glacieryarn dlx shadcn@latest add @01orbital/ring-loader-glacierbunx --bun shadcn@latest add @01orbital/ring-loader-glacierGoldring-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.
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: "Gold",
body: "Gold over bronze.",
ground: "Voice Orb · gold",
} as const
/** The five Ring Loaders in Voice Orb's gold palette (gold over bronze), each labeled, with a three-dot color key. */
export default function RingLoaderGold() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.72 0.13 85)",
"--ld-b": "oklch(0.62 0.13 75)",
"--ld-c": "oklch(0.40 0.08 60)",
} 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-[oklch(0.72_0.13_85)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.62_0.13_75)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.40_0.08_60)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-goldnpx shadcn@latest add @01orbital/ring-loader-goldyarn dlx shadcn@latest add @01orbital/ring-loader-goldbunx --bun shadcn@latest add @01orbital/ring-loader-goldLight Noirring-loader-light-noir
Ring Loader Light Noir: an example of ring-loader.
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: "Light noir",
body: "Bold near-black ink on a light ground, with very little color.",
ground: "Light ground",
} as const
/** Five Ring Loaders in bold near-black ink on a white ground, from portal to crescent, with almost no color in them. */
export default function RingLoaderLightNoir() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.12 0.004 265)",
"--ld-b": "oklch(0.18 0.004 265)",
"--ld-c": "oklch(0.32 0.004 265)",
} 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-[oklch(0.12_0.004_265)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.18_0.004_265)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.32_0.004_265)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-light-noirnpx shadcn@latest add @01orbital/ring-loader-light-noiryarn dlx shadcn@latest add @01orbital/ring-loader-light-noirbunx --bun shadcn@latest add @01orbital/ring-loader-light-noirMintring-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.
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: "Mint",
body: "Fresh mint light with a blue-green turn, clear of olive tones.",
ground: "Dark ground",
} as const
/** Fresh mint green Ring Loaders in all five forms on an ink ground, with a blue-green turn and a small color key. */
export default function RingLoaderMint() {
return (
<Card className="dark 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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.68 0.14 165)",
"--ld-b": "oklch(0.86 0.10 165)",
"--ld-c": "oklch(0.76 0.12 175)",
} 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-[oklch(0.68_0.14_165)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.86_0.10_165)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.76_0.12_175)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-mintnpx shadcn@latest add @01orbital/ring-loader-mintyarn dlx shadcn@latest add @01orbital/ring-loader-mintbunx --bun shadcn@latest add @01orbital/ring-loader-mintMonotone Graphitering-loader-monotone-graphite
Ring Loader Monotone Graphite: an example of ring-loader.
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: "Monotone / Graphite",
body: "Three neutral graphite grays, softer than the light noir treatment.",
ground: "Light ground",
} as const
/** Portal, arc, orbit, pulse and crescent Ring Loaders in three neutral graphite grays on paper, softer than the noir set. */
export default function RingLoaderMonotoneGraphite() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.38 0 0)",
"--ld-b": "oklch(0.49 0 0)",
"--ld-c": "oklch(0.62 0 0)",
} 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-[oklch(0.38_0_0)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.49_0_0)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.62_0_0)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-monotone-graphitenpx shadcn@latest add @01orbital/ring-loader-monotone-graphiteyarn dlx shadcn@latest add @01orbital/ring-loader-monotone-graphitebunx --bun shadcn@latest add @01orbital/ring-loader-monotone-graphiteMonotone Silverring-loader-monotone-silver
Ring Loader Monotone Silver: an example of ring-loader.
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: "Monotone / Silver",
body: "White and silver on ink, without a colored rim or tint.",
ground: "Dark ground",
} as const
/** Five Ring Loaders in white and silver on an ink ground, without any colored rim, each form labeled below its ring. */
export default function RingLoaderMonotoneSilver() {
return (
<Card className="dark 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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.98 0 0)",
"--ld-b": "oklch(0.88 0 0)",
"--ld-c": "oklch(0.68 0 0)",
} 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-[oklch(0.98_0_0)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.88_0_0)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.68_0_0)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-monotone-silvernpx shadcn@latest add @01orbital/ring-loader-monotone-silveryarn dlx shadcn@latest add @01orbital/ring-loader-monotone-silverbunx --bun shadcn@latest add @01orbital/ring-loader-monotone-silverLoading Statering-loader-open-library
Ring Loader Loading State: an example of ring-loader.
"use client"
import { useState, type CSSProperties } from "react"
import { RingLoader } from "@/components/loader/ring-loader"
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
// The copy: change text here, not in the markup.
const COPY = {
eyebrow: "02 / Inline state",
title: "Open a small library",
description: "An inline request with a working retry state.",
ringLabel: "Loading the preview library",
ready: "Library ready.",
complete: "Complete library",
showRetry: "Show retry state",
loadingTitle: "Loading the library",
retryTitle: "Ready for another try",
loadingNote: "Preparing the preview collection.",
retryNote: "The local request is paused. Retry to start it again.",
readyNote: "The preview collection is ready to view.",
retry: "Retry library",
reload: "Load library again",
} as const
/** An inline loading state with a ring loader beside a short message, plus controls to finish the request, show a retry state or reload. */
export default function RingLoaderOpenLibrary() {
const [state, setState] = useState<"loading" | "retry" | "complete">(
"loading"
)
return (
<Card className="relative isolate w-full max-w-[400px] min-w-0 rounded-[20px] border border-border bg-background font-sans text-foreground shadow-none ring-0 [--card-spacing:--spacing(8)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<CardHeader className="min-w-0 gap-0">
<p className="text-[13px]/[22px] font-medium">{COPY.eyebrow}</p>
<CardTitle className="mt-3 text-lg/[26px] font-medium tracking-[-0.035em]">
{COPY.title}
</CardTitle>
<CardDescription className="mt-2.5 text-xs/[22px] text-muted-foreground">
{COPY.description}
</CardDescription>
</CardHeader>
<CardContent>
<Card className="min-h-[150px] min-w-0 justify-center rounded-2xl border border-border shadow-none ring-0 [--card-spacing:--spacing(6)] max-[400px]:[--card-spacing:--spacing(4.5)]">
<CardContent className="flex items-center gap-[18px] max-[400px]:flex-col max-[400px]:items-start">
{state === "loading" && (
<RingLoader
variant="portal"
size={44}
aria-label={COPY.ringLabel}
className="shrink-0"
style={
{
"--ld-a": "oklch(0.76 0.035 20)",
"--ld-b": "oklch(0.46 0.10 20)",
"--ld-c": "oklch(0.90 0.006 85)",
} as CSSProperties
}
/>
)}
<div className="min-w-0">
{state === "complete" ? (
<h4 role="status" className="text-sm/[23px] font-medium">
{COPY.ready}
</h4>
) : (
<h4 className="text-sm/[23px] font-medium">
{state === "loading" ? COPY.loadingTitle : COPY.retryTitle}
</h4>
)}
<p className="mt-2 text-xs/[21px] text-muted-foreground">
{state === "loading"
? COPY.loadingNote
: state === "retry"
? COPY.retryNote
: COPY.readyNote}
</p>
</div>
</CardContent>
</Card>
</CardContent>
<CardFooter className="flex-wrap gap-2.5">
{state === "loading" ? (
<>
<Button
variant="outline"
className="h-auto min-h-10 max-w-full px-[18px] py-2.5 text-[11px]/[18px] whitespace-normal"
onClick={() => setState("complete")}
>
{COPY.complete}
</Button>
<Button
variant="outline"
className="h-auto min-h-10 max-w-full px-[18px] py-2.5 text-[11px]/[18px] whitespace-normal"
onClick={() => setState("retry")}
>
{COPY.showRetry}
</Button>
</>
) : (
<Button
variant="outline"
className="h-auto min-h-10 max-w-full px-[18px] py-2.5 text-[11px]/[18px] whitespace-normal"
onClick={() => setState("loading")}
>
{state === "retry" ? COPY.retry : COPY.reload}
</Button>
)}
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-open-librarynpx shadcn@latest add @01orbital/ring-loader-open-libraryyarn dlx shadcn@latest add @01orbital/ring-loader-open-librarybunx --bun shadcn@latest add @01orbital/ring-loader-open-libraryOriginal Dustyring-loader-original-dusty
Ring Loader Original Dusty: an example of ring-loader.
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: "Original dusty",
body: "The native RingLoader rose, pale pink, and cool teal reference.",
ground: "Dark ground",
} as const
/** The stock Ring Loader colors, dusty rose, pale pink and cool teal, across all five forms on an ink ground. */
export default function RingLoaderOriginalDusty() {
return (
<Card className="dark 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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.666 0.098 20.0)",
"--ld-b": "oklch(0.771 0.061 351.3)",
"--ld-c": "oklch(0.736 0.056 196.0)",
} 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-[oklch(0.666_0.098_20.0)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.771_0.061_351.3)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.736_0.056_196.0)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-original-dustynpx shadcn@latest add @01orbital/ring-loader-original-dustyyarn dlx shadcn@latest add @01orbital/ring-loader-original-dustybunx --bun shadcn@latest add @01orbital/ring-loader-original-dustyPlanet 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.
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: "Planet 14",
body: "Scarlet over cobalt, Voice Orb's default colors.",
ground: "Voice Orb · planet-14",
} as const
/** The five Ring Loaders in Voice Orb's planet-14 palette (scarlet over cobalt, Voice Orb's default colors), each labeled, with a three-dot color key. */
export default function RingLoaderPlanet14() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.38 0.12 262)",
} 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-[oklch(0.62_0.19_38)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.55_0.19_32)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.38_0.12_262)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-planet-14npx shadcn@latest add @01orbital/ring-loader-planet-14yarn dlx shadcn@latest add @01orbital/ring-loader-planet-14bunx --bun shadcn@latest add @01orbital/ring-loader-planet-14Preparation Queuering-loader-preparation-queue
Ring Loader Preparation Queue: an example of ring-loader.
"use client"
import { useState, type CSSProperties } from "react"
import { RingLoader } from "@/components/loader/ring-loader"
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
// The copy: change text here, not in the markup.
const COPY = {
eyebrow: "03 / Pending rows",
title: "A short preparation queue",
description: "Complete the files one at a time, or replay the queue.",
listLabel: "Files to prepare",
ready: "Ready",
queued: "Queued",
reset: "Reset files",
readySuffix: "ready",
preparingPrefix: "Preparing",
allReady: "All files ready",
next: "Complete next file",
} as const
const FILES = [
{ name: "field-notes.pdf", detail: "Document · 240 KB" },
{ name: "palette-preview.png", detail: "Image · 820 KB" },
] as const
/** A short list of files where the next pending row shows a ring loader, then Ready, with buttons to complete a file or reset the queue. */
export default function RingLoaderPreparationQueue() {
const [finished, setFinished] = useState(0)
return (
<Card className="relative isolate w-full max-w-[400px] min-w-0 rounded-[20px] border border-border bg-background font-sans text-foreground shadow-none ring-0 [--card-spacing:--spacing(8)] max-[380px]:[--card-spacing:--spacing(5.5)]">
<CardHeader className="min-w-0 gap-0">
<p className="text-[13px]/[22px] font-medium">{COPY.eyebrow}</p>
<CardTitle className="mt-3 text-lg/[26px] font-medium tracking-[-0.035em]">
{COPY.title}
</CardTitle>
<CardDescription className="mt-2.5 text-xs/[22px] text-muted-foreground">
{COPY.description}
</CardDescription>
</CardHeader>
<CardContent>
<ol
className="grid min-w-0 list-none gap-2.5"
aria-label={COPY.listLabel}
>
{FILES.map((file, index) => (
<li
key={file.name}
className="flex min-w-0 items-center justify-between gap-3.5 rounded-[14px] border border-border px-3.5 py-[17px] max-[400px]:gap-2.5 max-[400px]:px-3 max-[400px]:py-[15px]"
>
<div className="min-w-0 [overflow-wrap:anywhere]">
<h4 className="text-xs/5 font-medium">{file.name}</h4>
<p className="mt-1 text-[10px]/[18px] text-muted-foreground">
{file.detail}
</p>
</div>
<div className="grid min-w-10 shrink-0 place-items-center text-[10px]/[18px]">
{index < finished ? (
<span
role="status"
aria-label={`${file.name} ${COPY.readySuffix}`}
>
{COPY.ready}
</span>
) : index === finished ? (
<RingLoader
variant="portal"
size={28}
aria-label={`${COPY.preparingPrefix} ${file.name}`}
style={
{
"--ld-a": "oklch(0.76 0.035 20)",
"--ld-b": "oklch(0.46 0.10 20)",
"--ld-c": "oklch(0.90 0.006 85)",
} as CSSProperties
}
/>
) : (
<span>{COPY.queued}</span>
)}
</div>
</li>
))}
</ol>
</CardContent>
<CardFooter className="flex-wrap gap-2.5">
<Button
variant="outline"
className="h-auto min-h-10 max-w-full px-[18px] py-2.5 text-[11px]/[18px] whitespace-normal"
disabled={finished === FILES.length}
onClick={() =>
setFinished((count) => Math.min(FILES.length, count + 1))
}
>
{finished === FILES.length ? COPY.allReady : COPY.next}
</Button>
<Button
variant="outline"
className="h-auto min-h-10 max-w-full px-[18px] py-2.5 text-[11px]/[18px] whitespace-normal"
onClick={() => setFinished(0)}
>
{COPY.reset}
</Button>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-preparation-queuenpx shadcn@latest add @01orbital/ring-loader-preparation-queueyarn dlx shadcn@latest add @01orbital/ring-loader-preparation-queuebunx --bun shadcn@latest add @01orbital/ring-loader-preparation-queuePrepare Previewring-loader-prepare-preview
Ring Loader Prepare Preview: an example of ring-loader.
"use client"
import { useState, type CSSProperties } from "react"
import { RingLoader } from "@/components/loader/ring-loader"
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
// The copy: change text here, not in the markup.
const COPY = {
eyebrow: "01 / Button",
title: "Prepare a preview",
description: "Start a request, then finish or reset it yourself.",
ringLabel: "Preparing the preview",
ready: "Preview ready.",
complete: "Complete preview",
reset: "Reset preview",
busyLabel: "Preparing preview",
replay: "Replay preview",
start: "Prepare preview",
busyNote: "Use Complete to finish the request.",
idleNote: "Ready to start.",
} as const
/** An outline button that shows a small ring loader inside it while a preview request runs, with controls to finish or reset the request. */
export default function RingLoaderPreparePreview() {
const [state, setState] = useState<"idle" | "preparing" | "complete">("idle")
const busy = state === "preparing"
return (
<Card className="relative isolate w-full max-w-[400px] min-w-0 rounded-[20px] border border-border bg-background font-sans text-foreground shadow-none ring-0 [--card-spacing:--spacing(8)] max-[380px]:[--card-spacing:--spacing(5.5)]">
<CardHeader className="min-w-0 gap-0">
<p className="text-[13px]/[22px] font-medium">{COPY.eyebrow}</p>
<CardTitle className="mt-3 text-lg/[26px] font-medium tracking-[-0.035em]">
{COPY.title}
</CardTitle>
<CardDescription className="mt-2.5 text-xs/[22px] text-muted-foreground">
{COPY.description}
</CardDescription>
</CardHeader>
<CardContent className="flex min-h-[150px] flex-1 flex-col items-center justify-center gap-[18px]">
<div className="relative inline-flex max-w-full">
<Button
variant="outline"
disabled={busy}
aria-busy={busy}
onClick={() => setState("preparing")}
className={
busy
? "h-auto min-h-10 max-w-full gap-3 bg-transparent py-2.5 pr-[18px] pl-[54px] text-center whitespace-normal text-inherit hover:bg-transparent disabled:opacity-100 dark:hover:bg-transparent"
: "h-auto min-h-10 max-w-full gap-3 bg-transparent px-[18px] py-2.5 text-center whitespace-normal text-inherit hover:bg-transparent disabled:opacity-100 dark:hover:bg-transparent"
}
>
<span className="whitespace-normal">
{busy
? COPY.busyLabel
: state === "complete"
? COPY.replay
: COPY.start}
</span>
</Button>
{busy && (
<RingLoader
variant="portal"
size={24}
aria-label={COPY.ringLabel}
className="pointer-events-none absolute top-1/2 left-[18px] -translate-y-1/2"
style={
{
"--ld-a": "oklch(0.76 0.035 20)",
"--ld-b": "oklch(0.46 0.10 20)",
"--ld-c": "oklch(0.90 0.006 85)",
} as CSSProperties
}
/>
)}
</div>
{state === "complete" ? (
<p
role="status"
className="m-0 text-center text-[11px]/5 text-muted-foreground"
>
{COPY.ready}
</p>
) : (
<p className="m-0 text-center text-[11px]/5 text-muted-foreground">
{busy ? COPY.busyNote : COPY.idleNote}
</p>
)}
</CardContent>
<CardFooter className="flex-wrap gap-2.5">
<Button
variant="outline"
className="h-auto min-h-10 max-w-full px-[18px] py-2.5 text-[11px]/[18px] whitespace-normal"
onClick={() => setState("complete")}
>
{COPY.complete}
</Button>
<Button
variant="outline"
className="h-auto min-h-10 max-w-full px-[18px] py-2.5 text-[11px]/[18px] whitespace-normal"
onClick={() => setState("idle")}
>
{COPY.reset}
</Button>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-prepare-previewnpx shadcn@latest add @01orbital/ring-loader-prepare-previewyarn dlx shadcn@latest add @01orbital/ring-loader-prepare-previewbunx --bun shadcn@latest add @01orbital/ring-loader-prepare-previewRosering-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.
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: "Rose",
body: "Rose over plum.",
ground: "Voice Orb · rose",
} as const
/** The five Ring Loaders in Voice Orb's rose palette (rose over plum), each labeled, with a three-dot color key. */
export default function RingLoaderRose() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.64 0.15 15)",
"--ld-b": "oklch(0.56 0.14 8)",
"--ld-c": "oklch(0.38 0.10 350)",
} 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-[oklch(0.64_0.15_15)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.56_0.14_8)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.38_0.10_350)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-rosenpx shadcn@latest add @01orbital/ring-loader-roseyarn dlx shadcn@latest add @01orbital/ring-loader-rosebunx --bun shadcn@latest add @01orbital/ring-loader-roseTidering-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.
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: "Tide",
body: "Teal over deep indigo: cool and quiet.",
ground: "Voice Orb · tide",
} as const
/** The five Ring Loaders in Voice Orb's tide palette (teal over deep indigo: cool and quiet), each labeled, with a three-dot color key. */
export default function RingLoaderTide() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.58 0.10 200)",
"--ld-b": "oklch(0.50 0.10 205)",
"--ld-c": "oklch(0.34 0.10 258)",
} 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-[oklch(0.58_0.10_200)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.50_0.10_205)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.34_0.10_258)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-tidenpx shadcn@latest add @01orbital/ring-loader-tideyarn dlx shadcn@latest add @01orbital/ring-loader-tidebunx --bun shadcn@latest add @01orbital/ring-loader-tideUmberring-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.
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: "Umber",
body: "Coral over rose.",
ground: "Voice Orb · umber",
} as const
/** The five Ring Loaders in Voice Orb's umber palette (coral over rose), each labeled, with a three-dot color key. */
export default function RingLoaderUmber() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.66 0.14 42)",
"--ld-b": "oklch(0.58 0.13 38)",
"--ld-c": "oklch(0.45 0.09 25)",
} 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-[oklch(0.66_0.14_42)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.58_0.13_38)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.45_0.09_25)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-umbernpx shadcn@latest add @01orbital/ring-loader-umberyarn dlx shadcn@latest add @01orbital/ring-loader-umberbunx --bun shadcn@latest add @01orbital/ring-loader-umberVioletring-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.
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: "Violet",
body: "Bright violet and lilac, kept within the purple family.",
ground: "Dark ground",
} as const
/** Five Ring Loaders in bright violet and lilac on a plum surface, one for each form from portal to crescent. */
export default function RingLoaderViolet() {
return (
<div className="dark flex w-full justify-center">
<Card className="theme-plum 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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.62 0.20 300)",
"--ld-b": "oklch(0.87 0.09 300)",
"--ld-c": "oklch(0.72 0.18 310)",
} 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-[oklch(0.62_0.20_300)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.87_0.09_300)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.72_0.18_310)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
</div>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-violetnpx shadcn@latest add @01orbital/ring-loader-violetyarn dlx shadcn@latest add @01orbital/ring-loader-violetbunx --bun shadcn@latest add @01orbital/ring-loader-violetViridianring-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.
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: "Viridian",
body: "Green over shadow.",
ground: "Voice Orb · viridian",
} as const
/** The five Ring Loaders in Voice Orb's viridian palette (green over shadow), each labeled, with a three-dot color key. */
export default function RingLoaderViridian() {
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)] max-[480px]:[--card-spacing:--spacing(5.5)]">
<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": "oklch(0.50 0.08 178)",
"--ld-b": "oklch(0.43 0.07 182)",
"--ld-c": "oklch(0.30 0.05 190)",
} 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-[oklch(0.50_0.08_178)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.43_0.07_182)]" />
<span className="size-2.5 rounded-full border border-[color-mix(in_oklab,var(--foreground)_25%,transparent)] bg-[oklch(0.30_0.05_190)]" />
<p className="ml-auto font-mono text-[10px]/[18px] text-muted-foreground">
{COPY.ground}
</p>
</CardFooter>
</Card>
)
}
import { cn } from "cn"
// Ring Loader — five calm ring loaders from the void set. All motion is
// transform/opacity only; reduced motion swaps spins for a slow breath.
// The default trio, Voice Orb's planet-14 colors: its scarlet pair, and its
// cobalt lifted to a mid blue so all three read on light and dark pages.
// Override the vars to retint.
const PALETTE = {
"--ld-a": "oklch(0.62 0.19 38)",
"--ld-b": "oklch(0.55 0.19 32)",
"--ld-c": "oklch(0.56 0.15 262)",
}
const RING_MASK =
"radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))"
const CSS = `@keyframes ld-spin{to{transform:rotate(360deg)}}
@keyframes ld-pulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(0.92)}}
@keyframes ld-breathe{0%,100%{opacity:0.45}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-slot="ring-loader"] *{animation:ld-breathe 2.5s ease-in-out infinite !important}}`
type LoaderVariant = "portal" | "arc" | "orbit" | "pulse" | "crescent"
/**
* 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.
*/
function RingLoader({
variant = "portal",
size = 48,
className,
style,
...props
}: React.ComponentProps<"div"> & {
/**
* `portal` spins a three-color ring, `arc` a fading arc, `orbit` a dot
* around a faint track, `pulse` pulses a ring and a center dot, and
* `crescent` spins an arc over a faint track.
*/
variant?: LoaderVariant
/** Width and height in px. */
size?: number
}) {
const ring = (background: string, animation: string) => (
<i
className="absolute inset-0 rounded-full"
style={{
background,
mask: RING_MASK,
animation,
}}
/>
)
return (
<div
data-variant={variant}
role="status"
aria-label="Loading"
className={cn("relative inline-block", className)}
style={
{
width: size,
height: size,
...PALETTE,
...style,
} as React.CSSProperties
}
// After the spread: the reduced-motion CSS above selects on this slot.
data-slot="ring-loader"
{...props}
>
<style>{CSS}</style>
{variant === "portal" &&
ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-b), var(--ld-c), var(--ld-a))",
"ld-spin 2s linear infinite"
)}
{variant === "arc" &&
ring(
"conic-gradient(from 0deg, var(--ld-b), transparent 120deg)",
"ld-spin 1.8s linear infinite"
)}
{variant === "orbit" && (
<>
<i className="absolute inset-0 rounded-full border border-current/15" />
<i className="absolute inset-0 animate-[ld-spin_1.5s_linear_infinite]">
<i className="absolute top-0 left-1/2 size-2 -translate-x-1/2 rounded-full bg-(--ld-b) shadow-[0_0_10px_var(--ld-b),0_0_20px_var(--ld-a)]" />
</i>
</>
)}
{variant === "pulse" && (
<>
{ring(
"conic-gradient(from 180deg, var(--ld-a), var(--ld-c), var(--ld-a))",
"ld-pulse 2s ease-in-out infinite"
)}
<i className="absolute top-1/2 left-1/2 size-[30%] -translate-1/2 animate-[ld-pulse_2s_ease-in-out_0.2s_infinite] rounded-full bg-(--ld-b)" />
</>
)}
{variant === "crescent" && (
<>
<i className="absolute inset-0 rounded-full border-2 border-current/8" />
{ring(
"conic-gradient(from 270deg, var(--ld-b), var(--ld-a), transparent 90deg, transparent)",
"ld-spin 2s linear infinite"
)}
</>
)}
</div>
)
}
export { RingLoader }
pnpm dlx shadcn@latest add @01orbital/ring-loader-viridiannpx shadcn@latest add @01orbital/ring-loader-viridianyarn dlx shadcn@latest add @01orbital/ring-loader-viridianbunx --bun shadcn@latest add @01orbital/ring-loader-viridianAPI 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