| hideNavTabs | R Documentation |
Hides tabs until they are useful, for example the results tabs before any data has been uploaded, and shows them again from the server.
hideNavTabs(rootID, tabIDs)
showNavTabs(rootID, tabIDs)
rootID |
ID of the row of tabs. |
tabIDs |
IDs of the tabs to hide or show, as a character vector. |
rootID is the id of the biLevelTab(), triSubTab() or
triSubSidebarTab() holding the tabs, or "root" for the top-level tabs in
the navigation bar. tabIDs are the tabs to hide or show:
Sub tabs: their values. These default to the title with spaces removed,
and spaces are removed here too, so the titles themselves work.
Top-level tabs (rootID = "root"): their titles, exactly as written,
spaces included.
showNavTabs() also selects the first tab in tabIDs, briefly selecting
the second first, so the tab's contents are drawn straight away.
NULL, invisibly. Called for its effect on the page.
if (interactive()) {
shiny::shinyApp(
ui = UINav(
appName = "Demo",
biLevelTab("Results",
subTab("Start", navButton("go", "Show the results")),
subTab("Table", navOutputText("tableText")),
subTab("Plot", navOutputText("plotText"))
)
),
server = function(input, output, session) {
hideNavTabs("Results", c("Table", "Plot"))
shiny::observeEvent(input$go, {
showNavTabs("Results", c("Table", "Plot"))
})
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.