Skip to content
Discussion options

You must be logged in to vote

Hi! You can do it like this:

JSX:

<ScrollToTop smooth className="scrollButton" />

And in your CSS Stylesheet:

.scrollButton {
  /* Edit this to your liking, this is just the base stylesheet used in this component */
  background-color: white;
  right: 40px;
  bottom: 40px;
  position: fixed;
  z-index: 2;
  cursor: pointer;
  border-radius: 7px;
  width: 40px;
  height: 40px;
  transition: opacity 1s ease-in-out;
  box-shadow: 0 9px 25px 0 rgba(132, 128, 177, 0.28);
  border: none;
  outline: none;
}

.scrollButton:hover svg {
 /* Change color of arrow on hover :) */
  fill: red
}

Let me know if it works for you :)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@patrivet
Comment options

Answer selected by patrivet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants