{
  "id": "back-to-top",
  "name": "Back to Top Button",
  "category": "navigation",
  "tags": [
    "scroll",
    "top",
    "fixed",
    "smooth scroll",
    "anchor"
  ],
  "description": "A floating round button that smoothly scrolls the page back to the top.",
  "url": "https://copy-css.com/snippets/back-to-top",
  "markdown": "https://copy-css.com/snippets/back-to-top.md",
  "html": "<a class=\"to-top\" href=\"#top\" aria-label=\"Back to top\">\n  <svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 19V5M5 12l7-7 7 7\"/></svg>\n</a>",
  "css": "/* Smooth scrolling for anchor links (respects reduced motion) */\n@media (prefers-reduced-motion: no-preference) {\n  html { scroll-behavior: smooth; }\n}\n\n.to-top {\n  position: fixed;\n  right: 24px;\n  bottom: 24px;\n  display: grid;\n  place-items: center;\n  width: 48px;\n  height: 48px;\n  border-radius: 50%;\n  background: #0d9488;\n  box-shadow: 0 8px 20px -6px rgba(13, 148, 136, 0.6);\n  color: #fff;\n  transition: transform 0.2s ease, background 0.2s ease;\n}\n\n.to-top:hover {\n  background: #0f766e;\n  transform: translateY(-3px);\n}",
  "features": [
    "transitions",
    "transforms",
    "box shadows",
    "CSS Grid",
    "reduced-motion support"
  ],
  "customProperties": []
}
