Binary Star
React + Tailwind
const css = `
@keyframes loader-binary-star-spin { to { transform: rotate(360deg); } }
.loader-binary-star {
position: relative;
width: 108px;
height: 108px;
}
.loader-binary-star__track {
position: absolute;
inset: 4px;
border-radius: 50%;
border: 1px dashed light-dark(#dbdde1, #2e3035);
}
.loader-binary-star__pair,
.loader-binary-star__planet-orbit {
position: absolute;
inset: 0;
animation: loader-binary-star-spin 1.6s linear infinite;
}
.loader-binary-star__planet-orbit { inset: 4px; animation-duration: 6s; }
/* Each star leads a trail: a quarter-ring conic gradient fading behind it. */
.loader-binary-star__trail {
position: absolute;
left: 50%;
top: 50%;
width: 44px;
height: 44px;
margin: -22px 0 0 -22px;
border-radius: 50%;
background: conic-gradient(from 0deg, transparent 0deg 200deg, color-mix(in oklab, light-dark(#373a40, #f1f2f3) 55%, transparent) 360deg);
mask-image: radial-gradient(circle, transparent 0 55%, #000 57% 66%, transparent 68%);
}
.loader-binary-star__trail--b { transform: rotate(180deg); }
.loader-binary-star__star {
position: absolute;
left: 50%;
top: calc(50% - 22px);
width: 9px;
height: 9px;
margin: -4.5px 0 0 -4.5px;
border-radius: 50%;
background: light-dark(#373a40, #f1f2f3);
box-shadow: 0 0 10px 2px color-mix(in oklab, light-dark(#373a40, #f1f2f3) 55%, transparent);
}
.loader-binary-star__star--b {
top: calc(50% + 22px);
width: 6px;
height: 6px;
margin: -3px 0 0 -3px;
background: light-dark(#50535b, #c6c8cd);
}
.loader-binary-star__planet {
position: absolute;
left: 50%;
top: -2px;
width: 5px;
height: 5px;
margin-left: -2.5px;
border-radius: 50%;
background: light-dark(#5f626a, #a7abb2);
}
.loader-binary-star__barycentre {
position: absolute;
left: 50%;
top: 50%;
width: 2px;
height: 2px;
margin: -1px;
background: light-dark(#cbced3, #393c41);
}
@media (prefers-reduced-motion: reduce) {
.loader-binary-star__pair, .loader-binary-star__planet-orbit { animation-duration: 12s; }
}
`;
export function BinaryStarLoader() {
return (
<>
<style>
{css}
</style>
<div className="loader-binary-star" role="status" aria-label="Loading">
<span className="loader-binary-star__track" aria-hidden="true" />
<span className="loader-binary-star__barycentre" aria-hidden="true" />
<span className="loader-binary-star__pair" aria-hidden="true">
<span className="loader-binary-star__trail" />
<span className="loader-binary-star__trail loader-binary-star__trail--b" />
<span className="loader-binary-star__star" />
<span className="loader-binary-star__star loader-binary-star__star--b" />
</span>
<span className="loader-binary-star__planet-orbit" aria-hidden="true">
<span className="loader-binary-star__planet" />
</span>
</div>
</>
);
}Markup where the component goes, CSS in your stylesheet. No JavaScript.
HTML
<div class="loader-binary-star" role="status" aria-label="Loading">
<span class="loader-binary-star__track" aria-hidden="true"></span>
<span class="loader-binary-star__barycentre" aria-hidden="true"></span>
<span class="loader-binary-star__pair" aria-hidden="true">
<span class="loader-binary-star__trail"></span>
<span class="loader-binary-star__trail loader-binary-star__trail--b"></span>
<span class="loader-binary-star__star"></span>
<span class="loader-binary-star__star loader-binary-star__star--b"></span>
</span>
<span class="loader-binary-star__planet-orbit" aria-hidden="true">
<span class="loader-binary-star__planet"></span>
</span>
</div>CSS
@keyframes loader-binary-star-spin { to { transform: rotate(360deg); } }
.loader-binary-star {
position: relative;
width: 108px;
height: 108px;
}
.loader-binary-star__track {
position: absolute;
inset: 4px;
border-radius: 50%;
border: 1px dashed light-dark(#dbdde1, #2e3035);
}
.loader-binary-star__pair,
.loader-binary-star__planet-orbit {
position: absolute;
inset: 0;
animation: loader-binary-star-spin 1.6s linear infinite;
}
.loader-binary-star__planet-orbit { inset: 4px; animation-duration: 6s; }
/* Each star leads a trail: a quarter-ring conic gradient fading behind it. */
.loader-binary-star__trail {
position: absolute;
left: 50%;
top: 50%;
width: 44px;
height: 44px;
margin: -22px 0 0 -22px;
border-radius: 50%;
background: conic-gradient(from 0deg, transparent 0deg 200deg, color-mix(in oklab, light-dark(#373a40, #f1f2f3) 55%, transparent) 360deg);
mask-image: radial-gradient(circle, transparent 0 55%, #000 57% 66%, transparent 68%);
}
.loader-binary-star__trail--b { transform: rotate(180deg); }
.loader-binary-star__star {
position: absolute;
left: 50%;
top: calc(50% - 22px);
width: 9px;
height: 9px;
margin: -4.5px 0 0 -4.5px;
border-radius: 50%;
background: light-dark(#373a40, #f1f2f3);
box-shadow: 0 0 10px 2px color-mix(in oklab, light-dark(#373a40, #f1f2f3) 55%, transparent);
}
.loader-binary-star__star--b {
top: calc(50% + 22px);
width: 6px;
height: 6px;
margin: -3px 0 0 -3px;
background: light-dark(#50535b, #c6c8cd);
}
.loader-binary-star__planet {
position: absolute;
left: 50%;
top: -2px;
width: 5px;
height: 5px;
margin-left: -2.5px;
border-radius: 50%;
background: light-dark(#5f626a, #a7abb2);
}
.loader-binary-star__barycentre {
position: absolute;
left: 50%;
top: 50%;
width: 2px;
height: 2px;
margin: -1px;
background: light-dark(#cbced3, #393c41);
}
@media (prefers-reduced-motion: reduce) {
.loader-binary-star__pair, .loader-binary-star__planet-orbit { animation-duration: 12s; }
}Goal: Create a "Binary Star" loader.
Visual behavior: Two stars of different sizes orbit their shared centre with comet trails behind them, while a small planet circles both on a wider, slower path.
Technique:
- The pair is one element spinning every 1.6s holding both stars on opposite sides of the centre, so they always orbit the barycentre together.
- Each trail is a quarter-ring conic gradient fading to transparent behind its star (masked to a thin ring), rotated with the pair.
- The planet sits on a dashed outer track and orbits every 6s.
Accessibility: The root has role="status" and aria-label="Loading"; everything inside is decorative. Under prefers-reduced-motion the orbits slow to 12s.
My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}
My colors: neutral only. Black, white and grays, no hues. Use the color values above as written, or my project's closest neutral tokens.
Return a single self-contained component. No dependencies.Goal: Create a "Binary Star" loader.
Visual behavior: Two stars of different sizes orbit their shared centre with comet trails behind them, while a small planet circles both on a wider, slower path.
Technique:
- The pair is one element spinning every 1.6s holding both stars on opposite sides of the centre, so they always orbit the barycentre together.
- Each trail is a quarter-ring conic gradient fading to transparent behind its star (masked to a thin ring), rotated with the pair.
- The planet sits on a dashed outer track and orbits every 6s.
Accessibility: The root has role="status" and aria-label="Loading"; everything inside is decorative. Under prefers-reduced-motion the orbits slow to 12s.
My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}
My colors: use my project's existing color tokens. The color values above are grayscale placeholders. Map each one by its role (surface, text, border, accent, glow) to my theme, and keep their relative lightness so contrast and the effect still read.
Return a single self-contained component. No dependencies.Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Free to use in any project, commercial included. MIT-0, no attribution required. Licence
About this component
Two stars of different sizes orbit their shared centre with comet trails behind them, while a small planet circles both on a wider, slower path.
- Dependencies
- None
- Difficulty
- Beginner
- Triggers
- continuous, loop, glow
- Techniques
- conic gradient, keyframes, transform only
- Reduced motion
- Respected
- Theme
- Light and dark (follows your page's color-scheme)
The root has role="status" and aria-label="Loading"; everything inside is decorative. Under prefers-reduced-motion the orbits slow to 12s.