Exercise

Create tab boxes

Now that you have created tabs on the sidebar, and tabs in the body, we can add boxes within each of the body's tabs (and there can be tabs within the boxes!) You can add a tabBox() directly to the dashboardBody() or place it within a tabItem(). Here is an example of a tabBox() directly in the dashboardBody(). The tabPanel() function is from the shiny package and will add tabs within the box.

body <-  dashboardBody(
    tabBox(
      title = "Tracking the International Space Station",
      tabPanel("Tab1", "Content for the first tab"),
      tabPanel("Tab2", "Content for the second tab")
    )
  )

Add a tabBox() to the dashboard body you have been working on in the previous exercises.

Instructions

100 XP
  • Add a tabBox() to the dashboard tabItem().
  • Add a title to the tabBox() "International Space Station Fun Facts".
  • Add two tabPanel()s to the tabBox() named "Fun Fact 1" and "Fun Fact 2".
  • Rerun the shiny app with these updates.