Learn R Programming

spsComps (version 0.1.0)

spsDepend: Add commonly used HTML dependencies

Description

Mostly used in SPS internal development

Usage

spsDepend(dep, js = TRUE, css = 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?

Value

htmltools::htmlDependency object

Details

For dep, current options are:

  • basic: spsComps basic css and js

  • shinydashboard: shinydashboard package, css and js

  • AdminLTE: shinydashboard package, often used together with "shinydashboard", css and js

  • 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

Examples

Run this code
# NOT RUN {
spsDepend("basic")
# shinydashboard has both js and css and if we only want to use css:
spsDepend("shinydashboard", css = FALSE)
# 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