DDBS UI
footers

Back To Top Button

A scroll-to-top control, round or inline, that fades in after a scroll threshold and respects reduced motion.

npx shadcn@latest add https://ui.develop-better-solutions.com/r/back-to-top-button.json
Dependencies:lucide-react
Fullscreen
Round
Inline

Usage

back-to-top-button-example.tsx
import { BackToTopButton } from "@dbs/ui";

export default function BackToTopButtonExample() {
  return (
    <div className="flex items-center gap-10">
      <div className="flex flex-col items-center gap-2">
        <BackToTopButton variant="round" threshold={0} />
        <span className="text-xs text-ink-muted">Round</span>
      </div>
      <div className="flex flex-col items-center gap-2">
        <BackToTopButton variant="inline" threshold={0} />
        <span className="text-xs text-ink-muted">Inline</span>
      </div>
    </div>
  );
}