#' @title Turbo Link
#'
#' @description A Link that targets specific Turbo visits
#'
#' @param action (str) advance (add history) or replace (don't add history)
#' @param frame (str) targeted frame (can be "_top" for whole page) or NULL
#' for the ancestor turbo frame.
#' @param tag (fun) target function to generate tag
#' @param ... (tag) content of the page
#'
#' @family Turbo
#' @export
turbo_link <- function(...,
action = c("advance", "replace"),
frame = NULL,
tag = tags$a) {
action <- match_arg(action)
assert_function(tag)
tag(...) %>%
add_data(`turbo-action` = action, `turbo-frame` = frame) %>%
add_class("turbo_link")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.