{
  "id": "spinning-border-button",
  "name": "Spinning Border Button",
  "category": "buttons",
  "tags": [
    "conic-gradient",
    "rotating",
    "glow",
    "dark",
    "ai"
  ],
  "description": "A dark button with a beam of light that travels around its border, the look used for AI features.",
  "url": "https://copy-css.com/snippets/spinning-border-button",
  "markdown": "https://copy-css.com/snippets/spinning-border-button.md",
  "html": "<button class=\"btn-spin-border\">Ask AI</button>",
  "css": ".btn-spin-border {\n  position: relative;\n  isolation: isolate;\n  overflow: hidden;\n  padding: 14px 34px;\n  border: 0;\n  border-radius: 12px;\n  background: #1e293b;\n  color: #e2e8f0;\n  font: 600 16px/1 system-ui, sans-serif;\n  cursor: pointer;\n}\n\n/* A large rotating conic gradient, clipped by the button */\n.btn-spin-border::before {\n  content: \"\";\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  z-index: -2;\n  width: 200%;\n  aspect-ratio: 1;\n  background: conic-gradient(#0000 0 65%, #38bdf8, #a78bfa, #0000 95%);\n  transform: translate(-50%, -50%);\n  animation: btn-spin-border-rotate 3s linear infinite;\n}\n\n/* The inner fill covers everything except a 2px ring */\n.btn-spin-border::after {\n  content: \"\";\n  position: absolute;\n  inset: 2px;\n  z-index: -1;\n  border-radius: 10px;\n  background: #0b1120;\n}\n\n.btn-spin-border:focus-visible {\n  outline: 2px solid #38bdf8;\n  outline-offset: 3px;\n}\n\n@keyframes btn-spin-border-rotate {\n  to { transform: translate(-50%, -50%) rotate(1turn); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .btn-spin-border::before { animation: none; }\n}",
  "features": [
    "keyframe animations",
    "transforms",
    "conic gradients",
    "aspect-ratio",
    "keyboard focus styles",
    "reduced-motion support"
  ],
  "customProperties": []
}
