返回顶部按钮

具有微交互、大地色调配色方案、商业/公司网站简单布局的 Back to Top 按钮组件;使用 Tailwind CSS 支持深色模式的响应式设计

预览

HTML 代码

<!-- Back to Top Button Component -->
<a href="#top" class="fixed bottom-6 right-6 flex items-center justify-center w-12 h-12 bg-emerald-700 text-white rounded-full shadow-lg transform transition-transform duration-200 hover:scale-110 hover:bg-emerald-600 dark:bg-emerald-600 dark:hover:bg-emerald-500" aria-label="Back to Top">
  <span class="sr-only">Back to Top</span>
  <svg class="w-6 h-6" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true">
    <path stroke-linecap="round" stroke-linejoin="round" d="M5 15l7-7 7 7"/>
  </svg>
</a>

<!-- To enable smooth scrolling behavior across the page, add the `scroll-smooth` class to your `<html>` element: -->
<!-- <html class="scroll-smooth"> -->

相关组件

Back to Top Button 组件

一个响应式背靠上按钮,采用纸张/印刷灵感设计,使用带有微妙点缀的黑白配色方案。它适用于教育平台,包括深色模式支持和简洁、可访问的布局。

打开

回到顶部按钮

一个最小且响应迅速的“Back to Top”按钮组件,支持深色模式。它在向下滚动后显示,并使用平滑滚动在单击时将用户返回到页面顶部。没有 JavaScript 用于滚动,只有 CSS。

打开

返回页首按钮组件 - 粗野主义大地色调

一个复杂的“Back to Top”按钮组件,采用野兽派风格设计,采用朴实的配色方案,适用于博客/内容网站。它是响应式的,包括深色模式支持。

打开