Components Back to Top Button Back to Top Button Component

Back to Top Button Component

A responsive 'Back to Top' button component styled with Material Design principles, muted colors, and dark mode support, suitable for blog or content consumption websites.

Preview

HTML Code

<div class="fixed bottom-4 right-4 z-50">
  <button
    onclick="window.scrollTo({top: 0, behavior: 'smooth'});"
    class="hidden md:flex items-center justify-center w-12 h-12 rounded-full shadow-lg bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-200
           hover:bg-gray-300 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-gray-500
           transition-all duration-300 ease-in-out transform hover:scale-110"
    aria-label="Back to top"
  >
    <svg
      class="w-6 h-6"
      fill="none"
      stroke="currentColor"
      viewBox="0 0 24 24"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        stroke-linecap="round"
        stroke-linejoin="round"
        stroke-width="2"
        d="M5 10l7-7m0 0l7 7m-7-7v18"
      ></path>
    </svg>
  </button>
</div>

Related Components

Back to Top Button Component

A simple, artistic 'Back to Top' button designed for food/restaurant websites, featuring a watercolor-inspired grayscale aesthetic. It's responsive and supports dark mode.

Open

Back to Top Button

Back to Top Button Component with 3D design, vibrant color scheme, and complex interactive elements for social media interfaces, using Tailwind CSS. It includes responsive design and dark theme support.

Open

Back to Top Button Component

A minimalist and flat Back to Top Button Component for dashboards, featuring a monochromatic color scheme. It's moderately complex with interactive features, a responsive design, and dark theme support, built purely with HTML and Tailwind CSS.

Open