Files
neuf-www/web/src/components/layout/ToTop.tsx
2024-08-09 19:24:19 +02:00

17 lines
345 B
TypeScript

"use client";
import { useInView } from "react-intersection-observer";
import { Icon } from "../general/Icon";
export const ToTop = () => {
const scrollToTop = () => {
window.scrollTo({
top: 0,
behavior: "smooth",
});
};
return <button onClick={scrollToTop}>
Til toppen
<Icon type="arrowUp" />
</button>;
};