Insert a f7Tab in a f7Tabs

f7InsertTab(
  id,
  tab,
  target,
  position = c("before", "after"),
  select = FALSE,
  session = shiny::getDefaultReactiveDomain()
)

Arguments

id

f7Tabs id.

tab

f7Tab to insert.

target

f7Tab after of before which the new tab will be inserted.

position

Insert before or after: c("before", "after").

select

Whether to select the newly inserted tab. FALSE by default.

session

Shiny session object.

Examples

if (interactive()) { library(shiny) library(shinyMobile) shinyApp( ui = f7Page( title = "Insert a tab Before the target", f7TabLayout( panels = tagList( f7Panel(title = "Left Panel", side = "left", theme = "light", "Blabla", effect = "cover"), f7Panel(title = "Right Panel", side = "right", theme = "dark", "Blabla", effect = "cover") ), navbar = f7Navbar( title = "Tabs", hairline = FALSE, shadow = TRUE, leftPanel = TRUE, rightPanel = TRUE ), f7Tabs( animated = TRUE, id = "tabs", f7Tab( tabName = "Tab 1", icon = f7Icon("email"), active = TRUE, "Tab 1", f7Button(inputId = "go", label = "Go") ), f7Tab( tabName = "Tab 2", icon = f7Icon("today"), active = FALSE, "Tab 2" ) ) ) ), server = function(input, output, session) { observeEvent(input$go, { f7InsertTab( id = "tabs", position = "before", target = "Tab 2", tab = f7Tab (tabName = paste0("tab_", input$go), "Test"), select = TRUE ) }) } ) }