inset_text: Inset text

View source: R/inset_text.R

inset_textR Documentation

Inset text

Description

This function creates the GOV.UK inset text component, used to differentiate a block of text from the content that surrounds it, for example a quote, example, or additional information about the page.

Usage

inset_text(inputId, content)

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

content

Content to display in the inset. Accepts a plain character string, or shiny tag objects such as shiny::tags$b("Bold") or a shiny::tagList().

Value

an inset text HTML shiny tag object

See Also

Other Govstyle feedback types: confirmation_panel(), details(), gov_summary(), gov_tag(), label_hint(), 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(
    shinyGovstyle::inset_text(
      inputId = "note",
      content = paste(
        "It can take up to 8 weeks to register a lasting power of",
        "attorney if there are no mistakes in the application."
      )
    ),
    shinyGovstyle::inset_text(
      inputId = "note-rich",
      content = shiny::tagList(
        shiny::tags$b("Important: "),
        "you can also pass tag objects."
      )
    )
  ),
  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.