Learn R Programming

spsComps (version 0.2)

spsDepend: Add commonly used HTML dependencies

Description

Mostly used in SPS internal development or add dependencies for some server end functions. For most UI functions, the dependency has been automatically attached for you.

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.

Value

htmltools::htmlDependency object

Details

For dep, current options are:

  • basic: spsComps basic css and js

  • css_loading: for css loaders

  • update_pg: spsComps pgPaneUpdate function required, js only

  • update_timeline: spsComps spsTimeline function required, js only

  • font-awesome: font-awesome, css only

  • bttn: comes from shinyWidgets package, bttn.css, css only

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

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

  • gotop: required by spsGoTop function

  • animation: required for animation related functions to add animations for icons and other elements

  • css-loader: required for loader functions

Examples

Run this code
# NOT RUN {
# 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-home"),
      spsDepend("font-awesome")
    )

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

    }

    shinyApp(ui, server)
}
# }

Run the code above in your browser using DataLab