% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/service_navigation.R
\name{service_navigation}
\alias{service_navigation}
\title{Service navigation}
\usage{
service_navigation(links, service_name = NULL)
}
\arguments{
\item{links}{A vector of actionLinks to be added to the
service navigation. inputIDs are auto-generated by
lowercasing the link text and replacing all
non-alphanumeric characters with underscores, e.g.
"Overview page" becomes \code{overview_page}. For precise
control over inputIDs, supply a named vector where names
are the page titles and values are the inputIDs.}

\item{service_name}{An optional character string
containing the service name to be displayed in the
navigation bar}
}
\value{
Shiny tag object
}
\description{
Service navigation component consistent with the
\href{https://design-system.service.gov.uk/components/service-navigation/}{GDS service navigation}. # nolint

\strong{Note:} This component uses a hardcoded element ID
for the navigation list and mobile menu toggle. Using
multiple \code{service_navigation()} instances on the same
page will cause ID conflicts and the mobile menu toggle
may not work correctly.
}
\examples{
ui <- shiny::fluidPage(
  shinyGovstyle::header("Title", "Secondary heading"),
  shinyGovstyle::service_navigation(
     c("Summary data", "Detailed stats 1", "User guide")
  ),
  bslib::navset_hidden(
     id = "main_panels",
     bslib::nav_panel(
       "summary_data",
       shiny::tags$h2("Summary data")
     ),
     bslib::nav_panel(
       "detailed_stats_1",
       shiny::tags$h2("Detailed stats 1")
     ),
     bslib::nav_panel(
       "user_guide",
       shiny::tags$h2("User guide")
     )
   ),
   shinyGovstyle::footer(full = TRUE)
)

server <- function(input, output, session) {
  observeEvent(
    input$summary_data,
    bslib::nav_select("main_panels", "summary_data")
  )
  observeEvent(
    input$detailed_stats_1,
    bslib::nav_select("main_panels", "detailed_stats_1")
  )
  observeEvent(
    input$user_guide,
    bslib::nav_select("main_panels", "user_guide")
  )
}

if (interactive()) shiny::shinyApp(ui = ui, server = server)
}
\seealso{
Other Govstyle navigation: 
\code{\link{backlink_Input}()},
\code{\link{contents_link}()},
\code{\link{update_service_navigation}()}
}
\concept{Govstyle navigation}
