# Light border button

> A thin streak of light runs around the edge of the button, slowly and without stopping.

- Category: [Buttons](https://library.aimran.es/components/buttons)
- Built with: React + Motion
- Live editor: https://library.aimran.es/blocks/rotating-light-border
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

This is the understated cousin of the gradient border: one line of light instead of big streaks of color. It suits a premium feel, like the “Explore collection” link of a jeweler or the “Watch the film” button on a studio reel. Next to louder effects, this rotating light border reads as confident rather than flashy.

Around three seconds per lap looks elegant; faster starts to feel like a loading spinner. A bright accent on a dark page works best, since on white backgrounds the thin line can almost vanish.

## Code

### React (Motion)

```tsx
import { motion } from "framer-motion";

interface RotatingLightBorderProps {
  text?: string;
  color?: string;
  /** Segundos por vuelta del reflejo. */
  speed?: number;
}

export default function RotatingLightBorder({
  text = "Explore",
  color = "#2997ff",
  speed = 3,
}: RotatingLightBorderProps) {
  return (
    <div className="relative overflow-hidden rounded-full p-[1px]">
      <motion.span
        className="absolute inset-[-150%]"
        style={{ background: `conic-gradient(transparent 0 75%, ${color})` }}
        animate={{ rotate: 360 }}
        transition={{ duration: speed, repeat: Infinity, ease: "linear" }}
      />
      <button
        type="button"
        className="relative rounded-full bg-white dark:bg-[#1c1c1e] px-6 py-3 text-sm font-medium text-[#1d1d1f] dark:text-[#f5f5f7]"
      >
        {text}
      </button>
    </div>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Light border button” block (Buttons) from AIMRAN Library to my project.

## What it is
A thin streak of light runs around the edge of the button, slowly and without stopping.

## Chosen settings
- Text: "Explore"
- Color: #2997ff
- Speed: 3s (from 1 to 6s)

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with React + TypeScript, with framer-motion for the animation and lucide-react for the icons. If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import { motion } from "framer-motion";

interface RotatingLightBorderProps {
  text?: string;
  color?: string;
  /** Segundos por vuelta del reflejo. */
  speed?: number;
}

export default function RotatingLightBorder({
  text = "Explore",
  color = "#2997ff",
  speed = 3,
}: RotatingLightBorderProps) {
  return (
    <div className="relative overflow-hidden rounded-full p-[1px]">
      <motion.span
        className="absolute inset-[-150%]"
        style={{ background: `conic-gradient(transparent 0 75%, ${color})` }}
        animate={{ rotate: 360 }}
        transition={{ duration: speed, repeat: Infinity, ease: "linear" }}
      />
      <button
        type="button"
        className="relative rounded-full bg-white dark:bg-[#1c1c1e] px-6 py-3 text-sm font-medium text-[#1d1d1f] dark:text-[#f5f5f7]"
      >
        {text}
      </button>
    </div>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
