| layouts | R Documentation |
Build the main content area of a GOV.UK page. gov_main_layout() creates
the page's <main> landmark, and content can go straight inside it: items
simply stack one below the other. Use gov_row() and gov_box() only when
you need GOV.UK grid columns, such as two boxes side by side or a section
with a set column width. gov_text() is a container for body text.
gov_main_layout(..., inputID = "main", width = "standard")
gov_row(...)
gov_box(..., size = "full")
gov_text(...)
... |
include the components of the UI that you want within the main page. These components are made to flow through each other. See example |
inputID |
ID of the main div. Defaults to "main" |
width |
Width of the component. One of |
size |
size of the box in the row. Optional are full, one-half, two-thirds, one-third, three-quarters and one-quarter. Defaults to "full" |
a HTML shiny layout div
Other Govstyle page structure:
cookieBanner(),
footer(),
gov_page(),
header(),
phase_banner(),
skip_to_main()
ui <- shinyGovstyle::gov_page(
shinyGovstyle::header(
org_name = "Example",
service_name = "User Examples",
logo="shinyGovstyle/images/moj_logo.png"),
shinyGovstyle::gov_main_layout(
# Content with no columns goes straight into gov_main_layout()
shinyGovstyle::heading_text("Page heading", size = "l"),
shinyGovstyle::gov_text("Items stack one below the other."),
# Use gov_row() and gov_box() for side-by-side columns
shinyGovstyle::gov_row(
shinyGovstyle::gov_box(
size = "one-half",
shinyGovstyle::gov_text("govuk-grid-column-one-half")
),
shinyGovstyle::gov_box(
size = "one-half",
shinyGovstyle::gov_text("govuk-grid-column-one-half")
)
),
shinyGovstyle::gov_row(
shinyGovstyle::gov_box(
size = "one-third",
shinyGovstyle::gov_text("govuk-grid-column-one-third")
),
shinyGovstyle::gov_box(
size = "two-thirds",
shinyGovstyle::gov_text("govuk-grid-column-two-thirds")
)
),
shinyGovstyle::gov_row(
shinyGovstyle::gov_box(
size = "one-quarter",
shinyGovstyle::gov_text("govuk-grid-column-one-quarter")
),
shinyGovstyle::gov_box(
size = "three-quarters",
shinyGovstyle::gov_text("govuk-grid-column-three-quarters")
)
)
),
shinyGovstyle::footer(full = TRUE)
)
server <- function(input, output, session) {}
if (interactive()) shinyApp(ui = ui, server = server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.