label_hint: Label with Hint Function

View source: R/label_hint.R

label_hintR Documentation

Label with Hint Function

Description

This function inserts a label and optional hint.

Usage

label_hint(inputId, label, hint_input = NULL)

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>⁠.

label

Display label for the control, or NULL for no label. Accepts a plain character string, an HTML string, or shiny tag objects such as shiny::tags$b("Bold") or a shiny::tagList().

hint_input

Display hint label for the control, or NULL for no hint label. Accepts the same rich content as label, so it can include a link.

Value

a label hint HTML shiny tag object

See Also

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

Examples

ui <- shinyGovstyle::gov_page(
  shinyGovstyle::header(
    org_name = "Example",
    service_name = "User Examples",
    logo="shinyGovstyle/images/moj_logo.png"
  ),
  shinyGovstyle::gov_main_layout(
    label_hint(
      inputId = "label1",
      label = "This is a label",
      hint_input = "This is a hint"
    ),
    # Rich content: a link in the hint
    label_hint(
      inputId = "label2",
      label = "Bold label",
      hint_input = shiny::tagList(
        "See the ",
        shinyGovstyle::external_link(
          "https://www.gov.uk",
          "GOV.UK guidance"
        )
      )
    )
  ),
  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.