# Add a scroll to top button (Ionic 2 | Typescript)

**URL:** <https://forum.ionicframework.com/t/add-a-scroll-to-top-button-ionic-2-typescript/57285>\
**Category:** ionic-v3\
**Created:** [July 12, 2016, 1:01pm UTC](https://forum.ionicframework.com/t/add-a-scroll-to-top-button-ionic-2-typescript/57285 "2016-07-12T13:01:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidla](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/davidla/32/109812_2.png) [@davidla](https://forum.ionicframework.com/u/davidla)\
**Post date:** [July 12, 2016, 1:01pm UTC](https://forum.ionicframework.com/t/add-a-scroll-to-top-button-ionic-2-typescript/57285/1 "2016-07-12T13:01:50Z")

</div>

Hi everyone i am trying to add “scroll to top button.” that implement the following :

1. Show the button when user has scrolled down.
2. Hide the button when the user scrolls up.  
3 .If the button is tapped then scroll to the top and hide the button .

any suggestion for how make it right way?

thanks a lot 🙂

---

<div class="post-metadata">

**Author:** ![itlr](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/itlr/32/97646_2.png) [@itlr](https://forum.ionicframework.com/u/itlr)\
**Post date:** [July 13, 2016, 4:19pm UTC](https://forum.ionicframework.com/t/add-a-scroll-to-top-button-ionic-2-typescript/57285/2 "2016-07-13T16:19:18Z")

</div>

I didn’t try myself, but the APIs you need resides in ion-content compoent

> <https://github.com/ionic-team/ionic/blob/master/src/components/content/content.ts>

  

> <https://github.com/ionic-team/ionic/blob/master/src/components/content/content.ts>

  
etc…
