组件 Back to Top 按钮 Back to Top Button 组件

Back to Top Button 组件

一个响应式、视觉上吸引人的“返回顶部”按钮,具有三重配色方案、渐变和平滑过渡,适用于作品集网站,包括深色模式支持。

预览

HTML 代码

<div class="fixed bottom-6 right-6 z-50">
  <!-- The button is initially hidden and would be revealed by JS on scroll -->
  <!-- For demonstration, it's always visible here. In a real app, add a 'hidden' class by default -->
  <button aria-label="Scroll to top" class="group flex h-14 w-14 items-center justify-center rounded-full shadow-lg transition-all duration-300 ease-in-out hover:scale-110 focus:outline-none focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800
    bg-gradient-to-br from-emerald-400 via-teal-500 to-blue-600
    dark:from-emerald-600 dark:via-teal-700 dark:to-blue-800">
    <svg class="h-8 w-8 text-white transition-transform duration-300 ease-in-out group-hover:-translate-y-1" 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>

相关组件

Glassmorphism Rainbow 返回顶部农业按钮

一个复杂的、响应式的“Back to Top”按钮组件,具有玻璃形态设计和彩虹渐变,专为农业/农业网站量身定制。具有模糊效果和暗模式支持。

打开

回到顶部按钮 - 材料设计粉彩

一个响应式的 “Back to Top” 按钮组件,遵循 Material Design 原则,采用柔和的配色方案,专为作品集网站量身定制。它包括响应式设计和使用 Tailwind CSS 的深色模式支持。

打开

Back to Top 按钮

用于电子商务的返回顶部按钮,具有充满活力的深色模式设计。

打开