Back to Top Button Component
A responsive 'Back to Top' button component for e-commerce sites, featuring a black and white monochrome design with a bright accent color, and an engaging microinteraction on hover. Includes dark mode support.
HTML Code
<div class="fixed bottom-4 right-4 z-50">
<!-- Back to Top Button -->
<a href="#top" aria-label="Scroll back to top of page" class="group outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-gray-900 rounded-full">
<button class="relative w-12 h-12 md:w-14 md:h-14 lg:w-16 lg:h-16 flex items-center justify-center bg-white dark:bg-gray-800 rounded-full shadow-lg transition-all duration-300 ease-in-out transform group-hover:-translate-y-1 group-focus:-translate-y-1 group-active:-translate-y-1 group-hover:scale-105 group-focus:scale-105 group-active:scale-105 overflow-hidden border border-gray-200 dark:border-gray-700">
<!-- Background accent on hover -->
<div class="absolute inset-0 bg-purple-500 rounded-full scale-0 group-hover:scale-100 group-focus:scale-100 group-active:scale-100 transition-transform duration-300 ease-out"></div>
<!-- SVG Icon -->
<svg class="relative w-6 h-6 md:w-7 md:h-7 lg:w-8 lg:h-8 text-gray-800 dark:text-white group-hover:text-white dark:group-hover:text-white transition-colors duration-300 ease-in-out" 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>
</a>
</div>
Related Components
Back to Top Button Component
A simple Back to Top button designed in a brutalist style using Tailwind CSS, suitable for a portfolio website. It features a grayscale color scheme and dark theme support.
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.
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.