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.
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
Retro_Back_To_Top_Button
Retro/Vintage - Nostalgic Back to Top Button Component for Blog/Content consumption with Analogous color scheme. Complex design with responsive and dark mode support.
Neumorphic Back to Top Button
A neumorphic "Back to Top" button for e-commerce, offering a subtle, soft UI design that blends with the background using delicate shadows. It features analogous colors for a harmonious look, a simple layout, and responsive design with dark theme support, ideal for online shopping experiences.
Back to Top Button
A simple and elegant back-to-top button that appears fixed at the bottom-right corner of the screen. Features a subtle pastel color scheme and smooth hover/focus microinteractions. The button includes a responsive design with built-in dark mode support. When hovered, the button gently scales up and changes background color to provide visual feedback. The component uses Tailwind CSS classes only, with no JavaScript required.