Orbital loader
Eclipse
Two paths that meet, then drift apart. A single React component with its CSS built in and no dependencies. Install it with the shadcn CLI or copy the source.
Preview and installation
Run this command in any project set up with shadcn.
npx shadcn@latest add https://loadercn.vercel.app/r/orbit-eclipse.jsonAdded the @loadercn registry? Use the short form:
npx shadcn@latest add @loadercn/orbit-eclipseThen add it to your interface:
import { OrbitEclipse } from "@/components/ui/orbit-eclipse"
<OrbitEclipse size={48} speed={1.6} />Inherits text color. Accepts className, style, and a custom loading label. Respects reduced-motion preferences.
import type { CSSProperties, ComponentProps } from "react"
export type OrbitEclipseProps = ComponentProps<"span"> & {
size?: number
/** Duration of one cycle, in seconds. */
speed?: number
label?: string
}
export function OrbitEclipse({
size = 40,
speed = 1.6,
label = "Loading",
className,
style,
...props
}: OrbitEclipseProps) {
return (
<span
role="status"
aria-label={label}
{...props}
className={["orbit-eclipse-loader", className].filter(Boolean).join(" ")}
style={
{
width: size,
height: size,
"--loader-duration": `${Math.max(0.1, speed)}s`,
...style,
} as CSSProperties
}
>
<span aria-hidden="true" className="orbit-eclipse-loader-system">
<span
className="orbit-eclipse-loader-track"
style={{
inset: "0",
transform: "translateX(-18%) scale(.8)",
border:
"1px solid color-mix(in srgb, currentColor 20%, transparent)",
}}
>
<span
className="orbit-eclipse-loader-rotor"
style={{
animationDelay: `${-0.0 * Math.max(0.1, speed)}s`,
animationDirection: "normal",
}}
>
<span />
</span>
</span>
<span
className="orbit-eclipse-loader-track"
style={{
inset: "0",
transform: "translateX(18%) scale(.8)",
border:
"1px solid color-mix(in srgb, currentColor 20%, transparent)",
}}
>
<span
className="orbit-eclipse-loader-rotor"
style={{
animationDelay: `${-0.5 * Math.max(0.1, speed)}s`,
animationDirection: "normal",
}}
>
<span />
</span>
</span>
</span>
<style>{`
.orbit-eclipse-loader { display: inline-flex; flex-shrink: 0; }
.orbit-eclipse-loader-system { position: relative; width: 100%; height: 100%; }
.orbit-eclipse-loader-track { position: absolute; border-radius: 50%; }
.orbit-eclipse-loader-rotor { position: absolute; inset: 0; animation: orbit-eclipse-loader-motion var(--loader-duration) linear infinite; }
.orbit-eclipse-loader-rotor > span { position: absolute; top: 0; left: 50%; width: 16%; aspect-ratio: 1; border-radius: 50%; background: currentColor; transform: translate(-50%, -50%); }
.orbit-eclipse-loader-core { position: absolute; width: 17%; height: 17%; background: currentColor; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); }
@keyframes orbit-eclipse-loader-motion { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orbit-eclipse-loader-rotor { animation: none; transform: rotate(35deg); } }
`}</style>
</span>
)
}
Copy the complete file into your components directory. Styles are included.
When to use it
Use it for moments of alignment, like matching, merging, or resolving conflicts. The paths meet and part without a hard loop.
Props
Eclipse accepts size, speed, label, className, and style, like every loader in the collection. See the installation guide for the full reference.