This function create a detail component that you can click for further details.
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>.- type
Main type of label e.g. alpha or beta. Can be any word
- label
Text to display. Accepts a plain character string, or
shinytag objects such asshiny::tags$b("Bold")or ashiny::tagList(). Not required iffeedback_urlis supplied instead.- feedback_url
Optional URL used to auto-generate the standard GOV.UK phase banner feedback text, e.g. "This is a new service - your feedback (opens in new tab) will help us to improve it.", with
feedbacklinking tofeedback_url. Iffeedback_urlstarts withmailto:the text instead reads "This is a new service - please contact [email address] if you have any questions or feedback.". Exactly one oflabelorfeedback_urlmust be supplied.- width
Width of the component. One of
"standard"(the default, GOV.UK's usual 960px content width),"three-quarters"(three-quarters of the viewport, never narrower than standard),"full"(no max-width, so the container fills the viewport, with grid gutters also removed), or a CSS length (e.g."1400px","90vw") for a custom max-width.
See also
Other Govstyle page structure:
cookieBanner(),
footer(),
gov_layout(),
gov_page(),
header(),
layouts,
skip_to_main()
Examples
ui <- shinyGovstyle::gov_page(
shinyGovstyle::header(
org_name = "Example",
service_name = "User Examples",
logo = "shinyGovstyle/images/moj_logo.png"
),
shinyGovstyle::banner(
inputId = "banner", type = "Beta", 'This is a new service'
)
)
server <- function(input, output, session) {}
if (interactive()) shinyApp(ui = ui, server = server)
# Auto-generate the standard feedback text from a URL
shinyGovstyle::banner(
inputId = "banner",
type = "Beta",
feedback_url = "https://example.com/feedback"
)
#> <div class="govuk-phase-banner" id="banner">
#> <div class="govuk-width-container">
#> <p class="govuk-phase-banner__content">
#> <strong class="govuk-tag govuk-phase-banner__content__tag">Beta</strong>
#> <span class="govuk-phase-banner__text">
#> This is a new service - your <a href="https://example.com/feedback" class="govuk-link" target="_blank" rel="noopener noreferrer">feedback (opens in new tab)</a> will help us to improve it.
#> </span>
#> </p>
#> </div>
#> </div>
# Auto-generate contact text from a mailto: link
shinyGovstyle::banner(
inputId = "banner",
type = "Beta",
feedback_url = "mailto:feedback@example.com"
)
#> <div class="govuk-phase-banner" id="banner">
#> <div class="govuk-width-container">
#> <p class="govuk-phase-banner__content">
#> <strong class="govuk-tag govuk-phase-banner__content__tag">Beta</strong>
#> <span class="govuk-phase-banner__text">
#> This is a new service - please contact <a href="mailto:feedback@example.com" class="govuk-link">feedback@example.com</a> if you have any questions or feedback.
#> </span>
#> </p>
#> </div>
#> </div>
