# Autorotate through tabs on a TabContainer

**URL:** <https://forum.inductiveautomation.com/t/autorotate-through-tabs-on-a-tabcontainer/88757>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [April 12, 2024, 7:17pm UTC](https://forum.inductiveautomation.com/t/autorotate-through-tabs-on-a-tabcontainer/88757 "2024-04-12T19:17:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [April 12, 2024, 7:17pm UTC](https://forum.inductiveautomation.com/t/autorotate-through-tabs-on-a-tabcontainer/88757/1 "2024-04-12T19:17:21Z")

</div>

Is there a way to rotate through the tabs automatically?  
Like start at 0, wait amount of duration, then goto 1....etc..

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 12, 2024, 7:48pm UTC](https://forum.inductiveautomation.com/t/autorotate-through-tabs-on-a-tabcontainer/88757/2 "2024-04-12T19:48:23Z")

</div>

Maybe, but have you considered the Carousel component and its Autoplay configuration?

> **[Perspective - Carousel | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-embedding-palette/perspective-carousel)**
>
> The Carousel component allows you to display a selection of rotating views at a defined rate with a link to the view on a page in your project.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 12, 2024, 7:58pm UTC](https://forum.inductiveautomation.com/t/autorotate-through-tabs-on-a-tabcontainer/88757/3 "2024-04-12T19:58:06Z")

</div>

![Tab auto-index](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/3/a39ea70f284d15981af8aac7c8ee47e258f9c5af.gif)

Create an Expression Binding on `currentTabIndex`.

```auto
floor(
  (now(1000) / 3000) // 3000 ms on each tab
  % 3 // number of tabs
)

```

You may need further code if you want to stop the auto-index.

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [April 12, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/autorotate-through-tabs-on-a-tabcontainer/88757/4 "2024-04-12T20:01:33Z")

</div>

oooo...aaaahhh, I will defiantly look at it!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 12, 2024, 8:10pm UTC](https://forum.inductiveautomation.com/t/autorotate-through-tabs-on-a-tabcontainer/88757/5 "2024-04-12T20:10:10Z")

</div>

> [@mjohnson0238](#):
>
> defiantly

Defiantly! Wow, brave man! 🤺

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 12, 2024, 8:18pm UTC](https://forum.inductiveautomation.com/t/autorotate-through-tabs-on-a-tabcontainer/88757/6 "2024-04-12T20:18:21Z")

</div>

> [@Transistor](#):
>
> `// number of tabs`

Nit:  
You should be able to use the `len` expression function on `props.tabs`, to avoid hardcoding in the number of tabs.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 12, 2024, 8:21pm UTC](https://forum.inductiveautomation.com/t/autorotate-through-tabs-on-a-tabcontainer/88757/7 "2024-04-12T20:21:43Z")

</div>

Thanks, Paul!

```auto
// New and improved version!
floor(
  (now(1000) / 3000) // 3000 ms on each tab
  % len({this.props.tabs})
)

```

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [April 12, 2024, 8:38pm UTC](https://forum.inductiveautomation.com/t/autorotate-through-tabs-on-a-tabcontainer/88757/8 "2024-04-12T20:38:06Z")

</div>

lol, tis but a scratch!
