# Ionic 4 transition when switching tab

**URL:** <https://forum.ionicframework.com/t/ionic-4-transition-when-switching-tab/175758>\
**Category:** Ionic Framework\
**Created:** [October 17, 2019, 6:47pm UTC](https://forum.ionicframework.com/t/ionic-4-transition-when-switching-tab/175758 "2019-10-17T18:47:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamdrozdz](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@adamdrozdz](https://forum.ionicframework.com/u/adamdrozdz)\
**Post date:** [October 17, 2019, 6:47pm UTC](https://forum.ionicframework.com/t/ionic-4-transition-when-switching-tab/175758/1 "2019-10-17T18:47:18Z")

</div>

Hello,  
I’m currently developing a pretty basic Ionic 4 app with tabs layout. I would like a to have a transition for switching a tab to another, but I don’t know how to achieve that (without hacking it with CSS). All my tabs are defined in tabs.router.module.ts, as in generic ‘tabs’ starter template. In my TS, I use

> this.navCtrl.navigateForward(‘tabs/…’);

to navigate to another tab, however I’m getting no transition. I do have a transition, when page is defined in app-routing.module.ts. How can I get transition for switching between tabs? I was able to get them in Ionic 3 with no additional effort. Any help is greatly appreciated, thank you.

---

<div class="post-metadata">

**Author:** ![leonardofmed](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@leonardofmed](https://forum.ionicframework.com/u/leonardofmed)\
**Post date:** [October 18, 2019, 8:21pm UTC](https://forum.ionicframework.com/t/ionic-4-transition-when-switching-tab/175758/2 "2019-10-18T20:21:07Z")

</div>

Have you checked out the [Native Page Transitions](https://ionicframework.com/docs/native/native-page-transitions) plugin?

> The Native Page Transitions plugin uses native hardware acceleration to animate your transitions between views. You have complete control over the type of transition, the duration, and direction.

I never used with tabs, but looking at the code I would give a try:

```auto
// example of adding a transition when a page/modal closes
ionViewWillLeave() {

 let options: NativeTransitionOptions = {
    direction: 'up',
    duration: 500,
    slowdownfactor: 3,
    slidePixels: 20,
    iosdelay: 100,
    androiddelay: 150,
    fixedPixelsTop: 0,
    fixedPixelsBottom: 60
   }

 this.nativePageTransitions.slide(options)
   .then(onSuccess)
   .catch(onError);

}

```

---

<div class="post-metadata">

**Author:** ![adamdrozdz](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@adamdrozdz](https://forum.ionicframework.com/u/adamdrozdz)\
**Post date:** [October 18, 2019, 8:33pm UTC](https://forum.ionicframework.com/t/ionic-4-transition-when-switching-tab/175758/3 "2019-10-18T20:33:17Z")

</div>

Thanks for your suggestion, however I would like transitions to work in browser (PWA) and I see that only Android, iOS and Windows Phone platforms are supported.

---

<div class="post-metadata">

**Author:** ![leonardofmed](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@leonardofmed](https://forum.ionicframework.com/u/leonardofmed)\
**Post date:** [October 18, 2019, 8:39pm UTC](https://forum.ionicframework.com/t/ionic-4-transition-when-switching-tab/175758/4 "2019-10-18T20:39:18Z")

</div>

I see, have you already checked this [Josh Morony’s related tutorial](https://www.joshmorony.com/create-a-custom-modal-page-transition-animation-in-ionic/)? He uses the Animation from ionic core, so it should work for all platforms. It can achieve different animations, he uses a modal page as example, but should be easily implemented on tabs.

**UPDATE**  
Another link that may help you, more updated: [DEVDACTIC](https://devdactic.com/custom-ionic-animations/)

---

<div class="post-metadata">

**Author:** ![adamdrozdz](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@adamdrozdz](https://forum.ionicframework.com/u/adamdrozdz)\
**Post date:** [October 18, 2019, 8:41pm UTC](https://forum.ionicframework.com/t/ionic-4-transition-when-switching-tab/175758/5 "2019-10-18T20:41:15Z")

</div>

Thanks, I will check this out
