The Tabsets application demonstrates using tabs to organize output. To run the example type:
Tabsets are created by calling the
tabsetPanel function with a list of tabs created by the
tabPanel function. Each tab panel is provided a list of output elements which are rendered vertically within the tab.
In this example we added a summary and table view of the data to the Hello Shiny app, each rendered on their own tab. Here is the source code for the UI object:
Tabs and Reactive Data
Introducing tabs into our user interface underlines the importance of creating reactive expressions for shared data. In this example each tab provides its own view of the dataset. If the dataset is expensive to compute then our user interface might be quite slow to render. The
server function below demonstrates how to calculate the data once in a reactive expression and have the result be shared by all of the output tabs:
If you have questions about this article or would like to discuss ideas presented here, please post on RStudio Community. Our developers monitor these forums and answer questions periodically. See help for more help with all things Shiny.