spsDepend: Add commonly used HTML dependencies

View source: R/depend.R

spsDependR Documentation

Add commonly used HTML dependencies

Description

Add dependencies for some server end functions. For most UI functions, the dependency has been automatically attached for you when you call the function. Most server functions will also attach the dependency for you automatically too. However, a few server functions have to append the dependency before app start like addLoader. So you would need to call in this function somewhere in your UI. Read help of each function for details.

Usage

spsDepend(dep = "", js = TRUE, css = TRUE, listing = TRUE)

Arguments

dep

dependency names, see details

js

bool, use only javascript from this resource if there are both js and css files?

css

bool, use only CSS from this resource if there are both js and css files?

listing

bool, if your dep is invalid, list all options? FALSE will mute it.

Details

For dep, current options are:

  • basic: spsComps basic css and js

  • update_pg: spsComps pgPaneUpdate function required, js and css

  • update_timeline: spsComps spsTimeline function required, js only

  • font-awesome: font-awesome, css only

  • toastr: comes from shinytoastr package, toastr.js, css and js

  • pop-tip: enable enhanced bootstrap popover and tips, required for bsHoverPopover function. js only

  • gotop: required by spsGoTop function. js and css

  • animation: required for animation related functions to add animations for icons and other elements, like animateServer. js and css

  • css-loader: required for loader functions, like addLoader. js and css

  • sweetalert2: sweetalert2.js, required by shinyCheckPkg, js only

Value

htmltools::htmlDependency object

Examples

# list all options
spsDepend("")
# try some options
spsDepend("basic")
spsDepend("font-awesome")
# Then add it to your shiny app
if(interactive()){
    library(shiny)

    ui <- fluidPage(
      tags$i(class = "fa fa-house"),
      spsDepend("font-awesome")
    )

    server <- function(input, output, session) {

    }

    shinyApp(ui, server)
}

spsComps documentation built on July 26, 2023, 5:39 p.m.