These function loads the page layout in a gov layout. There is a selection of components that can sit within each other. The gov_main_layout is the overarching layout. The gov_row creates a each row and gov_box creates a box within the row. The gov_text is a container for text bodies.
Usage
gov_main_layout(..., inputID = "main", width = "standard")
gov_row(...)
gov_box(..., size = "full")
gov_text(...)Arguments
- ...
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
"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.- size
size of the box in the row. Optional are full, one-half, two-thirds, one-third and one-quarter. Defaults to "full"
See also
Other Govstyle page structure:
banner(),
cookieBanner(),
footer(),
gov_layout(),
gov_page(),
header(),
skip_to_main()
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::gov_row(
shinyGovstyle::gov_box(
size = "full",
shinyGovstyle::gov_text("govuk-grid-column-full")
)
),
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-third",
shinyGovstyle::gov_text("govuk-grid-column-two-third")
)
),
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)
