Pro plan
$12/mo
Every component, every update.
Customize
Usage
import { OrbitBorder } from "@/components/motionkit/orbit-border";
<OrbitBorder className="w-72">
<h3>Pro plan</h3>
<p>Every component, every update.</p>
</OrbitBorder>Motion
The exact curves this component runs, plotted with Motion's own maths.
Orbit
Runs on its own
Works in the App Router as is. Requires Tailwind CSS v4.
npm install motionSave as components/motionkit/orbit-border.tsx.
"use client";
import type { ReactNode } from "react";
import { motion, useReducedMotion } from "motion/react";
type OrbitBorderProps = {
children?: ReactNode;
/** Seconds per full orbit. */
duration?: number;
/** Color of the travelling light. */
color?: string;
/** Border thickness in pixels. */
width?: number;
className?: string;
};
export function OrbitBorder({
children,
duration = 4,
color = "#5FAEB4",
width = 1,
className = "",
}: OrbitBorderProps) {
const reduceMotion = useReducedMotion();
return (
<div
style={{ padding: width }}
className={`relative isolate overflow-hidden rounded-2xl bg-white/10 ${className}`}
>
{/* an oversized conic gradient spins behind the content; only the border gap shows it */}
<motion.div
aria-hidden
className="absolute left-1/2 top-1/2 -z-10 aspect-square w-[200%] -translate-x-1/2 -translate-y-1/2"
style={{ background: `conic-gradient(from 0deg, transparent 0deg 280deg, ${color} 340deg, transparent 360deg)` }}
animate={reduceMotion ? undefined : { rotate: 360 }}
transition={{ duration, repeat: Infinity, ease: "linear" }}
/>
<div style={{ borderRadius: `calc(1rem - ${width}px)` }} className="h-full bg-[#0C1010] p-6">
{children}
</div>
</div>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
| duration | number | 4 | Seconds per full orbit. |
| color | string | "#5FAEB4" | Color of the travelling light. |
| width | number | 1 | Border thickness in pixels. |
Featured
Studio plan
A light travels the border.
Border Beam
A small light that travels around any element's border at a steady pace. Subtle, premium, never distracting.
Realtime sync
Move your cursor across this card.
Spotlight Card
A card with a soft glow that tracks the pointer across its surface.
Edge functions
Tilt me with your cursor.
Tilt Card
A 3D card that tilts toward the pointer, with an optional moving glare.