Back To Top

A back to top button that appears after scrolling, with a ring that fills as the reader progresses. Smooth scroll that respects reduced motion.

src/registry/ui/back-to-top.tsx/r/back-to-top.json

Installation#

bash
npx shadcn@latest add https://ui.minidev.pro/r/back-to-top.json

Usage#

tsx
import { BackToTop } from "@/components/ui/back-to-top"

export function Example() {
  return <BackToTop />
}

API reference#

BackToTop props
PropTypeDefault
thresholdnumber400
targetReact.RefObject<HTMLElement | null>-
classNamestring-

Dependencies#

npm

lucide-react

Built from

No other MiniDev files
All navigation components