R/aaa-deps.R

Defines functions with_a11y_deps use_a11y

#' a11y assets dependency (internal)
#' @keywords internal
#' @noRd

use_a11y <- function() {
    ver <- tryCatch(as.character(utils::packageVersion("a11yShiny")),
        error = function(e) "0.0.0-dev"
    )

    htmltools::htmlDependency(
        name = "a11yShiny",
        version = ver,
        src = list(file = system.file("www", package = "a11yShiny")),
        stylesheet = c("css/a11yShiny.css"),
        script = c("js/a11yShiny.js")
    )
}


#' Attach a11y dependency to a tag (internal)
#' @keywords internal
#' @param tag HTML tag or tagList
#' @noRd

with_a11y_deps <- function(tag) {
    htmltools::attachDependencies(tag, list(use_a11y()))
}

Try the a11yShiny package in your browser

Any scripts or data that you put into this service are public.

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