import : 
import Totop from '@/component/ui/toTop';

import "@/assets/scss/components/totop.scss";
component : use


<Totop/>
config src/component/ui/toTop.tsx : setting

const trigger = useScrollTrigger({
      target: window ? window() : undefined,
      disableHysteresis: true, // Immediately trigger on scroll down/up past threshold
      threshold: -1, // Show button after scrolling ...px || -1 for show
});
const handleClick = (event: React.MouseEvent<HTMLDivElement> => {
      const anchor = (
            (event.target as HTMLDivElement).ownerDocument || document
      ).querySelector('#header');
      if (anchor) {
            anchor.scrollIntoView({
                  behavior: 'smooth', // Add smooth scrolling
                  block: 'end', // Adjust block alignment if needed ('start', 'center', 'end', 'nearest)
            });
      }
};