This function creates a tabs based table. It requires a single dataframe with a grouping variable.
Details
Every tab and panel id is prefixed with inputId, so several govTabs()
on one page work independently, even when they share the same group
values. The first tab is selected when the page loads.
As in the GOV.UK Design System, the tabs become a "Contents" list of links
with every table shown on small screens. govTabs() also does this when
its tabs do not fit on one row of the space it is given, for example in a
two-thirds column on a narrow window, rather than squashing the tabs.
See also
Other Govstyle tables tabs and accordions:
accordion(),
govReactable(),
govReactable-shiny,
govTable()
Examples
ui <- shinyGovstyle::gov_page(
shinyGovstyle::header(
org_name = "Example",
service_name = "User Examples",
logo = "shinyGovstyle/images/moj_logo.png",
logo_alt_text = "Ministry of Justice logo"
),
shinyGovstyle::gov_main_layout(
shinyGovstyle::govTabs("tabs", shinyGovstyle::case_data, "tabs")
),
shinyGovstyle::footer(full = TRUE)
)
server <- function(input, output, session) {}
if (interactive()) shinyApp(ui = ui, server = server)
