I'm using a tabsetPanel and and I now want to create a module that adds more than one tab to this panel. Here is my example code:
library(shiny)
library(tidyverse)
resultlistUI <- function(id) {
ns <- NS(id)
tabPanel(
title = "Result1",
"Some text here 2"
)
tabPanel(
title = "Result2",
"Some text here 3"
)
}
resultlist <- function(input, output, session) {
}
ui <- fluidPage(
tabsetPanel(
id = "tabs",
tabPanel(
title = "Tab 1",
"Some text here"
),
resultlistUI(id = "resultlist1")
)
)
server <- function(input, output, session) {
}
shinyApp(ui = ui, server = server)
I was first wondering why I could not simply separate the two tabs with a comma. When I execute the code only my second tab "Result2" is added to the tabsetPanel. I also tried to use tagList but then none of the tabs was shown. What am I doing wrong?
EDIT: Complete minimal reproducible example added - only first tab from main app and the second tab from the module are displayed.