# How to preserve last state in Tabs?

**URL:** <https://community.plotly.com/t/how-to-preserve-last-state-in-tabs/14694>\
**Category:** Dash Python\
**Created:** [October 18, 2018, 7:07am UTC](https://community.plotly.com/t/how-to-preserve-last-state-in-tabs/14694 "2018-10-18T07:07:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhay.verma](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@abhay.verma](https://community.plotly.com/u/abhay.verma)\
**Post date:** [October 18, 2018, 7:07am UTC](https://community.plotly.com/t/how-to-preserve-last-state-in-tabs/14694/1 "2018-10-18T07:07:42Z")

</div>

Lets say, I have a dash app layout with 2 tabs. Each tab has a callback associated with an input.  
At first, I navigated to tab-1 and provided an input to draw a table/graph. Now, when I switched to another tab (tab-2), I provided another input which is on the layout of that tab to get another table/graph. But when I switch back to tab-1, the previous state of tab-1 is lost and I need to provide input again. Can we have preserve last states in dcc.Tabs so that until the input is passed explicitly and the callback returns a new output, the last state/output is displayed until then.

---

<div class="post-metadata">

**Author:** ![oege](https://avatars.discourse-cdn.com/v4/letter/o/ecd19e/32.png) [@oege](https://community.plotly.com/u/oege)\
**Post date:** [October 18, 2018, 7:57am UTC](https://community.plotly.com/t/how-to-preserve-last-state-in-tabs/14694/2 "2018-10-18T07:57:28Z")

</div>

That should work automatically when you use the second method on this page (at least for me):

Method 2. Content as Tab Children ([https://dash.plot.ly/dash-core-components/tabs](https://dash.plot.ly/dash-core-components/tabs))

---

<div class="post-metadata">

**Author:** ![abhay.verma](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@abhay.verma](https://community.plotly.com/u/abhay.verma)\
**Post date:** [October 18, 2018, 9:54am UTC](https://community.plotly.com/t/how-to-preserve-last-state-in-tabs/14694/3 "2018-10-18T09:54:09Z")

</div>

In method-2, the tab layouts are fixed. But, I have a input component on each tab, so as soon I swap the tabs the previous content is cleared to get a new input from the user for a callback function.

---

<div class="post-metadata">

**Author:** ![wlong0827](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/wlong0827/32/6496_2.png) [@wlong0827](https://community.plotly.com/u/wlong0827)\
**Post date:** [April 23, 2019, 4:42am UTC](https://community.plotly.com/t/how-to-preserve-last-state-in-tabs/14694/4 "2019-04-23T04:42:45Z")

</div>

Hi, I have the same question. Has anyone been able to provide a good way to load Input or other component values from a data Store? Thanks!
