Skip to content

Commit

Permalink
Add offset to scroll to top
Browse files Browse the repository at this point in the history
  • Loading branch information
aidantrabs committed Mar 27, 2024
1 parent c1a68da commit 6267334
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/components/ScrollButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { Link } from 'react-scroll';
import { IoMdArrowUp } from "react-icons/io";

const ScrollButton: React.FC = () => {
return (
<div className="fixed bottom-6 right-8 z-50">
<Link
to="top"
smooth={true}
duration={500}
className="cursor-pointer"
offset={-75}
>
<div className="w-12 h-12 bg-deepMarine rounded-full shadow-lg flex items-center justify-center">
<IoMdArrowUp className="text-white" />
</div>
</Link>
</div>
);
};

export { ScrollButton };

0 comments on commit 6267334

Please sign in to comment.