R/use_preline.R

Defines functions use_preline

Documented in use_preline

#' Allows you to use 'preline' components
#'
#' See also: <https://preline.co/> and <https://preline.co/docs/index.html>
#'
#' @param version the version of 'preline' to use, default is 3.0.0
#' @param ... further arguments passed to [use_tailwind()]
#'
#' @return the required HTML-head tags to use 'preline' as `shiny.tag`
#'
#' @export
use_preline <- function(version = "3.0.0", ...) {
  js <- sprintf("https://cdn.jsdelivr.net/npm/preline@%s/preline.js", version)

  shiny::tagList(
    use_tailwind(...),
    shiny::tags$script(src = js)
  )
}
kylebutts/shiny.tailwind documentation built on April 17, 2025, 5:21 p.m.