a11y_fluidPage: Accessible fluid page

View source: R/layout.R

a11y_fluidPageR Documentation

Accessible fluid page

Description

A wrapper for shiny::fluidPage() with required title/lang, one main landmark, optional header/nav/aside/footer, skip link, and flexible layout CSS.

Usage

a11y_fluidPage(
  ...,
  title,
  lang = NULL,
  main = NULL,
  main_id = "main-content",
  header = NULL,
  nav = NULL,
  aside = NULL,
  footer = NULL
)

Arguments

...

Content to go inside ⁠<main>⁠ when main is NULL, or extra children to append to main

title

Page title (required)

lang

Language code (required)

main

(optional) ⁠<main>⁠ tag (tags$main(...)); if provided, it is normalized (id/class ensured)

main_id

(optional) ID to assign if the main has no id yet (default "main-content")

header

(optional) Header content or tags$header(...)

nav

(optional) Nav content or tags$nav(...)

aside

(optional) Aside content or tags$aside(...)

footer

(optional) Footer content or tags$footer(...)

Details

  • Enforces title and lang

  • Ensures exactly one ⁠<main id="main-content">⁠

  • Attaches the CSS dependency (use_a11y) for flexible layout (.a11y-flow)

  • Allows optional header/nav/aside/footer blocks

Value

A Shiny UI tag (page)

Examples

# Minimal accessible page
a11y_fluidPage(
  title = "My App",
  lang  = "en",
  htmltools::h1("Welcome")
)

# Page with header and footer
a11y_fluidPage(
  title  = "Dashboard",
  lang   = "de",
  header = htmltools::tags$header(htmltools::h1("Dashboard")),
  footer = htmltools::tags$footer("Footer content"),
  htmltools::p("Main content goes here")
)


a11yShiny documentation built on April 1, 2026, 5:07 p.m.