gov_summary: Tabs Function

View source: R/summary.R

gov_summaryR Documentation

Tabs Function

Description

This function creates a tabs based table. It requires a single dataframe with a grouping variable.

Usage

gov_summary(inputId, headers, info, action = FALSE, border = TRUE)

Arguments

inputId

The id assigned to the component's root element. For Shiny input components this is also the name used to access the value via ⁠input$<inputId>⁠.

headers

input for the row headers value

info

Summary information values for the table. Each value accepts a plain character string, or shiny tag objects such as shiny::tags$b("Bold") or a shiny::tagList(). Pass a list rather than a character vector to mix tag and string values.

action

whenever a change link is needed. Sets input to the value of the headers using lowercase and with underscore to replace gaps. Default set to FALSE

border

set if the table should have borders. Default set to TRUE

Value

a summary list table HTML shiny tag object

See Also

Other Govstyle feedback types: confirmation_panel(), details(), gov_tag(), inset_text(), label_hint(), noti_banner(), value_box(), warning_text()

Examples

# Create an example dataset
headers <- c(
  "Name",
  "Date of birth",
  "Contact information",
  "Contact details"
)
info <- c(
  "Sarah Philips",
  "5 January 1978",
  "72 Guild Street <br> London <br> SE23 6FH",
  "07700 900457 <br> sarah.phillips@example.com"
)

ui <- shinyGovstyle::gov_page(
  shinyGovstyle::header(
    org_name = "Example",
    service_name = "User Examples",
    logo="shinyGovstyle/images/moj_logo.png"
  ),
  shinyGovstyle::gov_main_layout(
    shinyGovstyle::gov_summary("sumID", headers, info, action = FALSE)
  ),
  shinyGovstyle::footer(full = TRUE)
)

server <- function(input, output, session) {}
if (interactive()) shinyApp(ui = ui, server = server)

shinyGovstyle documentation built on Oct. 16, 2026, 1:07 a.m.