Sam

Scroll To Top Button

Buttons

About

Scroll to top button useful for landing pages, automatically hides itself when not scrolled

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Scroll To Top Button to your project and fits it to your theme.

Code

How Scroll To Top Button is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { ScrollToTopButton } from "@/components/ui/scroll-to-top-button";

export default function DemoOne() {
  return (
    <main className="min-h-dvh w-full overflow-y-auto">
      <section className="h-dvh grid place-items-center text-lg w-screen">
      Scroll down ⇣
      </section>
      <div className="h-dvh w-full" />
      <ScrollToTopButton />
    </main>
  );
}

Dependencies

More in Buttons

View all
  • Button Save

    Button Save

    46
  • Button

    Button

    20
  • Eclipse Button

    Eclipse Button

    5
  • Button

    Button

    6
  • Button

    Button

    14
  • Button Group

    Button Group

    37
  • Button

    Button

    32
  • Split Button

    Split Button

    32