react-scroll-to-bottom icon indicating copy to clipboard operation
react-scroll-to-bottom copied to clipboard

How to use a customized auto hide `scroll to bottom` button?

Open mahdidavoodi7 opened this issue 4 years ago • 2 comments

this little button always shows up when I scroll to the top a bit.

Screen Shot 2020-09-29 at 1 10 30 PM but I don't know how to remove this component or use a customized one.

any help would be appreciated.

mahdidavoodi7 avatar Sep 29 '20 09:09 mahdidavoodi7

I used followButtonClassName props in ScrollToBottom , and then added background-image with background-size: 'contain' properties. worked for me. scroll

himanshuNegi755 avatar Nov 06 '20 12:11 himanshuNegi755

@mahdidavoodi7 I found some solutions. you can set followButtonClassName="someHiddenClass" to hidden build-in button, and manully add AutoHideFollowButton in your page. some code like:

import ScrollToBottom, { AutoHideFollowButton } from 'react-scroll-to-bottom';

<ScrollToBottom followButtonClassName="someHiddenClass"  >
  <LongList ></LongList>
  <AutoHideFollowButton className="someCustomClass" >
     <Button>Some Custom Button or Icon</Button>
  </AutoHideFollowButton>
</ScrollToBottom>

you also need overwrite styles for AutoHideFollowButton , some styles like:


.someCustomClass {
  background-color: transparent !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;

  &:hover {
    background-color: transparent  !important;
  }
}

koen-chen avatar Sep 03 '21 03:09 koen-chen