Git Product home page Git Product logo

bs4dash's Introduction

RinteRfaceVerse

Travis build status AppVeyor build status CRAN status

Wrap-up around RinteRface templates

Introduction

RinteRface gathers 4 templates to build nice looking dashboards with shiny. This package aims at bringing RinteRface templates closer to shiny beginners by suggesting plug and play boilerplates, ready to be customized. These templates are different from showcases you can find in each separate package.

Installation

devtools::install_github("RinteRface/RinteRfaceVerse")
library(RinteRfaceVerse)

Getting Started

Select the good template

The previewTemplate() function enables the user to preview 4 RinteRface templates, by selecting the relevant library:

previewTemplate(lib = "shinydashboardPlus")
previewTemplate(lib = "bs4Dash")
previewTemplate(lib = "argonDash")
previewTemplate(lib = "tablerDash")

Import a template

Once satisfied with a template, you can access its files with the useTemplate() function:

useTemplate(path = getwd(), lib = "shinydashboardPlus")

Deploy your app

Both shinyapps.io and RStudio Connect have an automated process to push your app online via deployTemplate(). For shiny server and shiny server pro, proceed "manually".

bs4dash's People

Contributors

agenius-mohammed-ali avatar ari-nz avatar davidbarke avatar divadnojnarg avatar duque-de-sealand avatar etiennebacher avatar federicomarini avatar galachad avatar itkonen avatar johncoene avatar mattwarkentin avatar statnmap avatar statup-github avatar stefaneng avatar yogat3ch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bs4dash's Issues

bs4DashNavbar skin arg does not work (?)

library(shiny)
library(bs4Dash)

shiny::shinyApp(
  ui = bs4DashPage(
    enable_preloader = FALSE,
    navbar = bs4DashNavbar(
      skin = "dark", 
      status = "white", 
      border = FALSE,
      sidebarIcon = "bars", 
      controlbarIcon = "th", leftUi = actionButton("goButton", "Go!"),
      rightUi = actionButton("goButton2", "Go2"), 
      fixed = FALSE
    ),
    sidebar = bs4DashSidebar(
      inputId = "sidebar", 
      disable = FALSE, 
      title = "My dashboard",
      skin = "dark", 
      status = "primary", 
      brandColor = "orange", 
      url = "https://google.com",
      src = "https://image.flaticon.com/icons/svg/145/145867.png", 
      elevation = 5, 
      opacity = 0.8,
      
      bs4SidebarUserPanel(img = "https://image.flaticon.com/icons/svg/1383/1383438.svg", text = "David"),
      
      bs4SidebarMenu(
        id = "sidebarmenu", 
        flat = FALSE, 
        compact = FALSE,
        child_indent = TRUE,
        bs4SidebarHeader("Menu1"),
        bs4SidebarMenuItem(
          "Tab 1", 
          tabName = "Tab1", 
          icon = NULL,
          startExpanded = FALSE
        ),
        bs4SidebarMenuItem(
          "Tab 2", 
          tabName = "Tab2", 
          icon = NULL,
          startExpanded = FALSE
        ),
        bs4SidebarMenuItem(
          text = "Tab 3",
          icon = "bars",
          startExpanded = FALSE,
          #active = FALSE,
          bs4SidebarMenuSubItem(
            text = "Tab 4",
            tabName = "Tab4",
            icon = "circle-thin"
          ),
          bs4SidebarMenuSubItem(
            text = "Tab 5",
            tabName = "Tab5",
            icon = "circle-thin"
          )
        )
      )
    ),
    controlbar = bs4DashControlbar(
      bs4DashControlbarMenu(
        id = "tabcard",
        side = "left",
        bs4DashControlbarItem(
          tabName = "Tab 1", 
          active = FALSE,
          "Content 1"
        ),
        bs4DashControlbarItem(
          tabName = "Tab 2", 
          active = TRUE,
          "Content 2"
        ),
        bs4DashControlbarItem(
          tabName = "Tab 3", 
          active = FALSE,
          "Content 3"
        )
      ),
      inputId = "controlbar", 
      disable = FALSE,
      skin = "dark", 
      title = "Controlbar", 
      width = 250
    ),
    
    footer = bs4DashFooter(copyrights = "@David", right_text = "Cool"),
    title = "test",
    body = bs4DashBody(
      bs4TabItems(
        bs4TabItem(
          tabName = "Tab1",
          bs4Card(
            title = "Closable Box with dropdown", 
            closable = TRUE, 
            width = 12,
            status = "warning", 
            solidHeader = FALSE, 
            collapsible = TRUE,
            labelText = 1,
            labelStatus = "danger",
            labelTooltip = "Hi Bro!",
            dropdownIcon = "wrench",
            maximizable = TRUE,
            dropdownMenu = dropdownItemList(
              dropdownItem(url = "http://www.google.com", name = "Link to google"),
              dropdownItem(url = "#", name = "item 2"),
              dropdownDivider(),
              dropdownItem(url = "#", name = "item 3")
            ),
            p("Box Content")
          )
        ),
        bs4TabItem(
          tabName = "Tab2",
          bs4Quote("Blablabla", status = "indigo"),
          bs4Quote("Blablabla", status = "danger"),
          bs4Quote("Blablabla", status = "teal"),
          bs4Quote("Blablabla", status = "orange"),
          bs4Quote("Blablabla", status = "warning"),
          bs4Quote("Blablabla", status = "fuchsia")
        )
      )
    )
  ),
  server = function(input, output) {
    
    observeEvent(input$sidebarmenu, {
      if (input$sidebarmenu == "Tab2") {
        showModal(modalDialog(
          title = "Important message",
          "This is an important message!"
        ))
      }
    })
    
    observe(print(input$sidebar))
    observe(print(input$sidebarmenu))
    observe(print(input$controlbar))
  }
)

Control bar not showing top elements when collapsed == FALSE

When a control bar is created and controlbar_collapsed = FALSE, then the control bar is created and the top elements are not visible. If the control bar is collapsed and then un-collapsed, the elements appear.

It appears that the elements are hidden underneath the navbar until re-displayed.

using 0.4.0.9000

bs4TabCard does not scale height automatically

If a bs4TabCard contains a bs4Box, it does not scale height automatically if bs4Box height exceeds 464px :

library(shiny)
library(bs4Dash)

shinyApp(
  ui = bs4DashPage(
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(
      bs4SidebarMenuItem(
        "Tabs",
        tabName = "tabs"
      )
    ),
    body = bs4DashBody(
      bs4TabItems(
        bs4TabItem(
          tabName = "tabs",
          bs4TabCard(
            bs4TabPanel(
              tabName = "test",
              active = TRUE,
              fluidRow(
                bs4Box(
                  height = "465px",
                  title = "Box 1",
                  "texte 1"
                )
              )
            )
          )
        )
      )
    )
  ),
  server = function(input, output) {}
)

bs4InfoBox is not correct when gradientColor is null

The bs4InfoBox, when gradientColor is null, should fill the icon with the status color and the card with white color. But it's filling all the card with the status color.

I adjust the function this way for me:

laInfoBox <- function (..., title, value = NULL, icon = NULL, iconElevation = 3, 
                       status = NULL, gradientColor = NULL, width = 4, elevation = NULL) 
{
    infoBoxCl <- if (!is.null(gradientColor)) {
        paste0("info-box bg-gradient-", gradientColor)
    }
    else {
         "info-box"
    }
    if (!is.null(elevation)) 
        infoBoxCl <- paste0(infoBoxCl, " elevation-", elevation)
    
    iconTag <- shiny::tags$span(
        class = if (is.null(status)) {
            "info-box-icon"
        }
        else {
            paste0("info-box-icon bg-", status)
        },
        class = if (!is.null(iconElevation)) 
            paste0("elevation-", iconElevation), 
        shiny::icon(icon))
    
    contentTag <- shiny::tags$div(class = "info-box-content", 
                                  shiny::tags$span(class = "info-box-text", title), shiny::tags$span(class = "info-box-number", 
                                                                                                     value), ...)
    infoBoxTag <- shiny::tags$div(class = infoBoxCl)
    infoBoxTag <- shiny::tagAppendChildren(infoBoxTag, iconTag, 
                                           contentTag)
    infoBoxTag <- shiny::tagList(shiny::singleton(shiny::tags$head(shiny::tags$style(shiny::HTML(if (is.null(status)) {
        if (is.null(gradientColor)) {
            paste0(".fa-", icon, "{\n                      color: #000;\n                     }\n                    ")
        }
        else {
            paste0(".fa-", icon, "{\n                      color: #fff;\n                     }\n                    ")
        }
    }
    else {
        if (status == "white") {
            paste0(".fa-", icon, "{\n                      color: #000;\n                     }\n                    ")
        }
        else {
            paste0(".fa-", icon, "{\n                      color: #fff;\n                     }\n                    ")
        }
    })))), infoBoxTag)
    shiny::tags$div(class = if (!is.null(width)) 
        paste0("col-sm-", width), infoBoxTag)
}

2019-08-02

bs4 info box stopped working after update from dev version

HI, thank you for this great package! But yesterday after the update I cannot see the icon rendering

output$info3 <- renderbs4InfoBox({
            bs4InfoBox(
                title = "AUC",
                value =tryCatch( out5()[[3]] ),
                icon = "bookmark",
                status = "info",
                gradientColor = ifelse(tryCatch( out5()[[3]] ) > 0.7,'green','warning')
            )
        })

Warning: Error in pickerInput: could not find function "pickerInput"

Hi
I have an issue with pickerInput when I try to publish it on server. The code is given below. The app works fine on local PC. No errors detected while sending it to the server. Server side log says:

2019-07-01T16:27:20.535676+00:00 shinyapps[997429]: Server version: 1.7.6-6 2019-07-01T16:27:20.535715+00:00 shinyapps[997429]: LANG: en_US.UTF-8 2019-07-01T16:27:20.535717+00:00 shinyapps[997429]: R version: 3.6.0 2019-07-01T16:27:20.535719+00:00 shinyapps[997429]: shiny version: 1.3.2 2019-07-01T16:27:20.535745+00:00 shinyapps[997429]: httpuv version: 1.5.1 2019-07-01T16:27:20.535760+00:00 shinyapps[997429]: rmarkdown version: (none) 2019-07-01T16:27:20.535762+00:00 shinyapps[997429]: knitr version: (none) 2019-07-01T16:27:20.535808+00:00 shinyapps[997429]: RJSONIO version: (none) 2019-07-01T16:27:20.535814+00:00 shinyapps[997429]: htmltools version: 0.3.6 2019-07-01T16:27:20.536029+00:00 shinyapps[997429]: Using pandoc at /opt/connect/ext/pandoc2 2019-07-01T16:27:20.741043+00:00 shinyapps[997429]: Using jsonlite for JSON processing 2019-07-01T16:27:20.535794+00:00 shinyapps[997429]: jsonlite version: 1.6 2019-07-01T16:27:20.747358+00:00 shinyapps[997429]: Starting R with process ID: '72' 2019-07-01T16:27:20.775379+00:00 shinyapps[997429]: 2019-07-01T16:27:20.775382+00:00 shinyapps[997429]: Listening on http://127.0.0.1:44674 2019-07-01T16:27:20.747355+00:00 shinyapps[997429]: 2019-07-01T16:27:20.901073+00:00 shinyapps[997429]: Warning: Error in pickerInput: could not find function "pickerInput" 2019-07-01T16:27:20.916811+00:00 shinyapps[997429]: 69: tag 2019-07-01T16:27:20.916815+00:00 shinyapps[997429]: 68: tags$form 2019-07-01T16:27:20.916817+00:00 shinyapps[997429]: 64: sidebarPanel

Any suggestion how to deal with this issue will be highly appreciated.

ui.R:
`
ui <- navbarPage("My database (v. 1.33)",

             tabPanel("Richness in vegetation types",
                      tags$head(tags$style(HTML("
           .shiny-output-error-validation {
           color: green;
           font-size:20px;
           }
                                     "))
                      ),
                      sidebarPanel(
                        radioButtons(inputId = "size",
                                     label = "Choose plot size [m2]:", 
                                     choices = c("0.0001" = "1e-04", "0.001" = "0.001",
                                                 "0.01" = "0.01", "0.1" = "0.1", "1" = "1", "10" = "10",
                                                 "100" = "100", "1000" = "1000"),
                                     #choices = levels(as.factor(GPlong$St.Area)),
                                     selected = 10,
                                     inline = TRUE
                        ),
                        selectInput('group', 'Select group of organisms:',
                                    choices = c("Vascular" = "Ric.vas", "Non vascular" = "Ric.non", "Bryophytes" = "Ric.bry", "Lichens" = "Ric.lic", "All tericulous" = "Ric.ter")),
                        #selectInput('biom', 'Select biom (Schultz modified with Körner):', levels(GP$Biom),
                        #            selected = "Temperate midlatitudes", multiple = TRUE),
                        pickerInput('biome', 'Select biome (Schultz modified with Körner):',
                                    choices = levels(GP$Biom), options = list(`actions-box` = TRUE),multiple = T,
                                    selected = levels(GP$Biom))
                        #uiOutput("dfSummaryButton")
                      ),
                      mainPanel(plotOutput('plot1')
                                #htmlOutput("profileSummary")
                      )
             ),
             tabPanel("Richness in biomes",
                      tags$head(tags$style(HTML("
           .shiny-output-error-validation {
           color: green;
           font-size:20px;
           }
                                     "))
                      ),
                      sidebarPanel(
                        radioButtons(inputId = "size1",
                                     label = "Choose plot size [m2]:", 
                                     choices = c("0.0001" = "1e-04", "0.001" = "0.001",
                                                 "0.01" = "0.01", "0.1" = "0.1", "1" = "1", "10" = "10",
                                                 "100" = "100", "1000" = "1000"),
                                     #choices = levels(as.factor(GPlong$St.Area)),
                                     selected = 10,
                                     inline = TRUE
                        ),
                        selectInput('group1', 'Select group of organisms:',
                                    choices = c("Vascular" = "Ric.vas", "Non vascular" = "Ric.non", "Bryophytes" = "Ric.bry", "Lichens" = "Ric.lic", "All tericulous" = "Ric.ter")),
                        #selectInput('type1', 'Select vegetation type:',
                        #            choices = levels(GPlong$Veg.type)),
                        pickerInput('type1', 'Select vegetation type:',
                                    choices = levels(GPlong$Veg.type), options = list(`actions-box` = TRUE),multiple = T,
                                    selected = levels(GPlong$Veg.type))
                      ),
                      mainPanel(plotOutput('plot2'))
             ),
             tabPanel("Descriptive statistics",
                      tags$head(tags$style(HTML("
           .shiny-output-error-validation {
           color: green;
           font-size:20px;
           }
                                     "))
                      ),
                      sidebarPanel(
                        radioButtons(inputId = "size2",
                                     label = "Choose plot size [m2]:", 
                                     choices = c("0.0001" = "1e-04", "0.001" = "0.001",
                                                 "0.01" = "0.01", "0.1" = "0.1", "1" = "1", "10" = "10",
                                                 "100" = "100", "1000" = "1000"),
                                     #choices = levels(as.factor(GPlong$St.Area)),
                                     selected = 10,
                                     inline = TRUE
                        ),
                        selectInput('group2', 'Select group of organisms:',
                                    choices = c("Vascular" = "Ric.vas", "Non vascular" = "Ric.non", "Bryophytes" = "Ric.bry", "Lichens" = "Ric.lic", "All tericulous" = "Ric.ter")),
                        pickerInput('type2', 'Select vegetation type:',
                                    choices = levels(GPlong$Veg.type),
                                    options = list(`actions-box` = TRUE),
                                    selected = levels(GPlong$Veg.type),
                                    multiple = TRUE),
                        #selectInput('biome2', 'Select biome (Schultz modified with Körner):', levels(GPlong$Biom),
                        #            selected = "Temperate midlatitudes", multiple = TRUE),
                        pickerInput('biome2', 'Select biome (Schultz modified with Körner):',
                                    choices = levels(GPlong$Biom),
                                    options = list(`actions-box` = TRUE),
                                    selected = levels(GPlong$Biom),
                                    multiple = TRUE)
                      ),
                      mainPanel(
                        htmlOutput("profileSummary")
                      )
             )

)

**session info:**R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=Polish_Poland.1250 LC_CTYPE=Polish_Poland.1250 LC_MONETARY=Polish_Poland.1250
[4] LC_NUMERIC=C LC_TIME=Polish_Poland.1250

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] summarytools_0.9.3 DT_0.7 ggplot2_3.2.0 shinyWidgets_0.4.8.940
[5] shiny_1.3.2 pastecs_1.3.21 tidyr_0.8.3 usethis_1.5.0
[9] devtools_2.0.2

loaded via a namespace (and not attached):
[1] tidyselect_0.2.5 remotes_2.1.0 pander_0.6.3 purrr_0.3.2 tcltk_3.6.0
[6] colorspace_1.4-1 htmltools_0.3.6 rlang_0.4.0 pkgbuild_1.0.3 later_0.8.0
[11] pillar_1.4.2 glue_1.3.1 withr_2.1.2 pryr_0.1.4 sessioninfo_1.1.1
[16] plyr_1.8.4 matrixStats_0.54.0 stringr_1.4.0 munsell_0.5.0 gtable_0.3.0
[21] htmlwidgets_1.3 codetools_0.2-16 memoise_1.1.0 labeling_0.3 callr_3.2.0
[26] httpuv_1.5.1 ps_1.3.0 curl_3.3 Rcpp_1.0.1 xtable_1.8-4
[31] openssl_1.4 promises_1.0.1 backports_1.1.4 scales_1.0.0 checkmate_1.9.3
[36] desc_1.2.0 pkgload_1.0.2 magick_2.0 jsonlite_1.6 mime_0.7
[41] fs_1.3.1 rapportools_1.0 askpass_1.1 packrat_0.5.0 digest_0.6.19
[46] stringi_1.4.3 processx_3.3.1 dplyr_0.8.1 rprojroot_1.3-2 grid_3.6.0
[51] cli_1.1.0 tools_3.6.0 bitops_1.0-6 magrittr_1.5 lazyeval_0.2.2
[56] RCurl_1.95-4.12 tibble_2.1.3 crayon_1.3.4 pkgconfig_2.0.2 rsconnect_0.8.13
[61] prettyunits_1.0.2 lubridate_1.7.4 assertthat_0.2.1 rstudioapi_0.10 R6_2.4.0
[66] boot_1.3-22 compiler_3.6.0 `

Optimal way to fix navigation bar header?

Thank you so much for making this excellent package! I am looking at converting some of my previous shinydashboard apps to use bs4Dash and one capability I'd like to build is freezing the navigation bar header to the top when scrolling down. Based on this SO question I put the following CSS in my app to fix the navigation bar:

.main-header {
  position: fixed;
  width:100%;
}

When I inject this CSS in one of your gallery example apps, the navigation bar indeed freezes but the width is too wide. I tried changing the width percentage to less than 100, but it ends up making the navigation bar not wide enough. Is there a better approach to freezing the navigation bar while maintaining the width correctly? Complete example is below (the styles.css file simply contains the above CSS fragment saved in a www subdirectory in the app directory):

library(shiny)
library(shinyWidgets)
library(bs4Dash)
library(plotly)

# plot 2
x <- seq(-2 * pi, 2 * pi, length.out = 1000)
df <- data.frame(x, y1 = sin(x), y2 = cos(x))

# plot 3
x <- rnorm(200)
y <- rnorm(200)

ui = bs4DashPage(
  navbar = bs4DashNavbar(
    status = "white",
    "I can write text in the navbar!",
    rightUi = bs4DropdownMenu(
      show = TRUE,
      labelText = "!",
      status = "danger",
      src = "https://www.google.fr",
      bs4DropdownMenuItem(
        text = "message 1",
        date = "today"
      ),
      bs4DropdownMenuItem(
        text = "message 2",
        date = "yesterday"
      )
    )
  ),
  sidebar = bs4DashSidebar(
    skin = "light",
    status = "primary",
    title = "bs4Dash",
    brandColor = "primary",
    url = "https://www.google.fr",
    src = "https://adminlte.io/themes/AdminLTE/dist/img/user2-160x160.jpg",
    elevation = 3,
    opacity = 0.8,
    bs4SidebarMenu(
      bs4SidebarHeader("Cards"),
      bs4SidebarMenuItem(
        "Basic cards",
        tabName = "cards",
        icon = "sliders"
      ),
      bs4SidebarMenuItem(
        "User cards",
        tabName = "usercards",
        icon = "object-ungroup"
      ),
      bs4SidebarMenuItem(
        "Tab cards",
        tabName = "tabcards",
        icon = "picture-o"
      ),
      bs4SidebarHeader("Boxes"),
      bs4SidebarMenuItem(
        "Basic boxes",
        tabName = "boxes",
        icon = "desktop"
      ),
      bs4SidebarMenuItem(
        "Value/Info boxes",
        tabName = "valueboxes",
        icon = "suitcase"
      ),
      bs4SidebarHeader("BS4 gallery"),
      bs4SidebarMenuItem(
        HTML(
          paste(
            "Gallery 1", 
            bs4Badge(
              "new", 
              position = "right", 
              status = "danger"
            )
          )
        ),
        tabName = "gallery1",
        icon = "paint-brush"
      ),
      bs4SidebarMenuItem(
        HTML(
          paste(
            "Gallery 2", 
            bs4Badge(
              "!", 
              position = "right", 
              status = "success"
            )
          )
        ),
        tabName = "gallery2",
        icon = "map"
      )
    )
  ),
  body = bs4DashBody(
    tags$head(
      tags$style(
        HTML(
          ".main-header {
            position: fixed;
            width:100%;
            }
          "
        )
      )
    ),
    bs4TabItems(
      bs4TabItem(
        tabName = "cards",
        fluidRow(
          bs4Card(
            title = "Closable card with dropdown", 
            closable = TRUE, 
            width = 6,
            status = "warning", 
            solidHeader = FALSE, 
            collapsible = TRUE,
            labelText = 1,
            labelStatus = "danger",
            labelTooltip = "Hi Bro!",
            dropdownIcon = "wrench",
            dropdownMenu = dropdownItemList(
              dropdownItem(url = "https://www.google.com", name = "Link to google"),
              dropdownItem(url = "#", name = "item 2"),
              dropdownDivider(),
              dropdownItem(url = "#", name = "item 3")
            ),
            plotOutput("plot")
          ),
          bs4Card(
            title = "Closable card with gradient", 
            closable = TRUE, 
            width = 6,
            status = "warning", 
            solidHeader = FALSE, 
            gradientColor = "success",
            collapsible = TRUE,
            plotOutput("distPlot")
          ),
          bs4Card(
            title = "Card with solidHeader and elevation", 
            elevation = 4,
            closable = TRUE, 
            width = 6,
            solidHeader = TRUE, 
            status = "primary",
            collapsible = TRUE,
            plot_ly(z = ~volcano) %>% add_surface()
          )
        )
      ),
      bs4TabItem(
        tabName = "usercards",
        fluidRow(
          bs4UserCard(
            src = "https://adminlte.io/themes/AdminLTE/dist/img/user1-128x128.jpg",
            status = "info",
            title = "User card type 1",
            subtitle = "a subtitle here",
            elevation = 4,
            "Any content here"
          ),
          bs4UserCard(
            type = 2,
            src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg",
            status = "success",
            imageElevation = 4,
            title = "User card type 2",
            subtitle = "a subtitle here",
            bs4ProgressBar(
              value = 5,
              striped = FALSE,
              status = "info"
            ),
            bs4ProgressBar(
              value = 5,
              striped = TRUE,
              status = "warning",
              width = "20%"
            )
          )
        )
      ),
      bs4TabItem(
        tabName = "tabcards",
        bs4TabCard(
          title = "A card with tabs",
          elevation = 2,
          width = 8,
          bs4TabPanel(
            tabName = "Tab1",
            active = FALSE,
            "A wonderful serenity has taken possession of my entire soul,
            like these sweet mornings of spring which I enjoy with my
            whole heart. I am alone, and feel the charm of existence in
            this spot, which was created for the bliss of souls like mine.
            I am so happy, my dear friend, so absorbed in the exquisite sense
            of mere tranquil existence, that I neglect my talents. I should be
            incapable of drawing a single stroke at the present moment; and yet
            I feel that I never was a greater artist than now"
          ),
          bs4TabPanel(
            tabName = "Tab2",
            active = TRUE,
            "The European languages are members of the same family.
            Their separate existence is a myth. For science, music,
            sport, etc, Europe uses the same vocabulary. The languages
            only differ in their grammar, their pronunciation and their
            most common words. Everyone realizes why a new common
            language would be desirable: one could refuse to pay expensive
            translators. To achieve this, it would be necessary to have
            uniform grammar, pronunciation and more common words. If several
            languages coalesce, the grammar of the resulting language is
            more simple and regular than that of the individual languages."
          ),
          bs4TabPanel(
            tabName = "Tab3",
            active = FALSE,
            "Lorem Ipsum is simply dummy text of the printing and
            typesetting industry. Lorem Ipsum has been the industry's
            standard dummy text ever since the 1500s, when an unknown
            printer took a galley of type and scrambled it to make a
            type specimen book. It has survived not only five centuries,
            but also the leap into electronic typesetting, remaining
            essentially unchanged. It was popularised in the 1960s with
            the release of Letraset sheets containing Lorem Ipsum passages,
            and more recently with desktop publishing software like Aldus
            PageMaker including versions of Lorem Ipsum."
          )
        )
      ),
      bs4TabItem(
        tabName = "valueboxes",
        h4("Value Boxes"),
        fluidRow(
          bs4ValueBox(
            value = 150,
            subtitle = "New orders",
            status = "primary",
            icon = "shopping-cart",
            href = "#"
          ),
          bs4ValueBox(
            elevation = 4,
            value = "53%",
            subtitle = "New orders",
            status = "danger",
            icon = "cogs"
          ),
          bs4ValueBox(
            value = "44",
            subtitle = "User Registrations",
            status = "warning",
            icon = "sliders"
          ),
          bs4ValueBox(
            value = "53%",
            subtitle = "Bounce rate",
            status = "success",
            icon = "database"
          )
        ),
        h4("Info Boxes"),
        fluidRow(
          bs4InfoBox(
            title = "Messages",
            value = 1410,
            icon = "envelope"
          ),
          bs4InfoBox(
            title = "Bookmarks",
            status = "info",
            value = 240,
            icon = "bookmark"
          ),
          bs4InfoBox(
            title = "Comments",
            gradientColor = "danger",
            value = 41410,
            icon = "comments"
          )
        )
      ),
      bs4TabItem(
        tabName = "boxes",
        fluidRow(
          bs4Box(
            height = "600px",
            title = "Box 1",
            plotlyOutput("plot2")
          ),
          bs4Box(
            height = "600px",
            title = "Box 2",
            plotlyOutput("plot3")
          )
        )
      ),
      bs4TabItem(
        tabName = "gallery1",
        fluidRow(
          bs4Card(
            title = "Accordions",
            footer = tagList(
              h4("There is an accordion in the footer!"),
              bs4Accordion(
                bs4AccordionItem(
                  id = "item1",
                  title = "Item 1", 
                  status = "danger",
                  "Anim pariatur cliche reprehenderit, enim 
                  eiusmod high life accusamus terry richardson ad 
                  squid. 3 wolf moon officia aute, non cupidatat 
                  skateboard dolor brunch. Food truck quinoa nesciunt 
                  laborum eiusmod. Brunch 3 wolf moon tempor, sunt 
                  aliqua put a bird on it squid single-origin coffee 
                  nulla assumenda shoreditch et. Nihil anim keffiyeh 
                  helvetica, craft beer labore wes anderson cred 
                  nesciunt sapiente ea proident. Ad vegan excepteur 
                  butcher vice lomo. Leggings occaecat craft beer farm-to-table, 
                  raw denim aesthetic synth nesciunt you probably haven't 
                  heard of them accusamus labore sustainable VHS"
                ),
                bs4AccordionItem(
                  id = "item2",
                  title = "Item 2", 
                  status = "warning",
                  "Anim pariatur cliche reprehenderit, enim 
                  eiusmod high life accusamus terry richardson ad 
                  squid. 3 wolf moon officia aute, non cupidatat 
                  skateboard dolor brunch. Food truck quinoa nesciunt 
                  laborum eiusmod. Brunch 3 wolf moon tempor, sunt 
                  aliqua put a bird on it squid single-origin coffee 
                  nulla assumenda shoreditch et. Nihil anim keffiyeh 
                  helvetica, craft beer labore wes anderson cred 
                  nesciunt sapiente ea proident. Ad vegan excepteur 
                  butcher vice lomo. Leggings occaecat craft beer farm-to-table, 
                  raw denim aesthetic synth nesciunt you probably haven't 
                  heard of them accusamus labore sustainable VHS"
                )
              )
            )
          ),
          bs4Card(
            title = "Carousel",
            bs4Carousel(
              id = "mycarousel",
              width = 12,
              bs4CarouselItem(
                active = TRUE,
                src = "https://placehold.it/900x500/39CCCC/ffffff&text=I+Love+Bootstrap"
              ),
              bs4CarouselItem(
                active = FALSE,
                src = "https://placehold.it/900x500/3c8dbc/ffffff&text=I+Love+Bootstrap"
              ),
              bs4CarouselItem(
                active = FALSE,
                src = "https://placehold.it/900x500/f39c12/ffffff&text=I+Love+Bootstrap"
              )
            )
          )
        ),
        fluidRow(
          bs4Card(
            title = "Progress bars",
            footer = tagList(
              bs4ProgressBar(
                value = 5,
                striped = FALSE,
                status = "info"
              ),
              bs4ProgressBar(
                value = 5,
                striped = TRUE,
                status = "warning",
                width = "20%"
              )
            ),
            bs4ProgressBar(
              value = 80,
              vertical = TRUE,
              status = "success"
            ),
            bs4ProgressBar(
              value = 100,
              vertical = TRUE,
              striped = TRUE,
              status = "danger",
              height = "80%"
            )
          ),
          bs4Card(
            title = "Alerts",
            elevation = 4,
            bs4Alert(
              title = "Be Careful!",
              status = "danger",
              closable = TRUE,
              width = 12,
              "Danger alert preview. This alert is dismissable. 
              A wonderful serenity has taken possession of my entire soul, 
              like these sweet mornings of spring which 
              I enjoy with my whole heart."
            )
          )
        ),
        fluidRow(
          bs4Card(
            title = "Callouts",
            bs4Callout(
              title = "I am a danger callout!",
              elevation = 4,
              status = "danger",
              width = 12,
              "There is a problem that we need to fix. 
              A wonderful serenity has taken possession of 
              my entire soul, like these sweet mornings of 
              spring which I enjoy with my whole heart."
            )
          ),
          bs4Card(
            title = "Loading State",
            bs4Loading()
          )
        ),
        fluidRow(
          bs4Card(
            title = "Timeline",
            bs4Timeline(
              width = 12,
              reversed = TRUE,
              bs4TimelineEnd(status = "danger"),
              bs4TimelineLabel("10 Feb. 2014", status = "info"),
              bs4TimelineItem(
                elevation = 4, 
                title = "Item 1",
                icon = "gears",
                status = "success",
                time = "now",
                footer = "Here is the footer",
                "This is the body"
              ),
              bs4TimelineItem(
                title = "Item 2",
                border = FALSE
              ),
              bs4TimelineLabel("3 Jan. 2014", status = "primary"),
              bs4TimelineItem(
                elevation = 2,
                title = "Item 3",
                icon = "paint-brush",
                status = "warning",
                bs4TimelineItemMedia(src = "https://placehold.it/150x100"),
                bs4TimelineItemMedia(src = "https://placehold.it/150x100")
              ),
              bs4TimelineStart(status = "danger")
            )
          ),
          bs4Timeline(
            width = 6,
            bs4TimelineEnd(status = "danger"),
            bs4TimelineLabel("10 Feb. 2014", status = "info"),
            bs4TimelineItem(
              elevation = 4, 
              title = "Item 1",
              icon = "gears",
              status = "success",
              time = "now",
              footer = "Here is the footer",
              "This is the body"
            ),
            bs4TimelineItem(
              title = "Item 2",
              border = FALSE
            ),
            bs4TimelineLabel("3 Jan. 2014", status = "primary"),
            bs4TimelineItem(
              elevation = 2,
              title = "Item 3",
              icon = "paint-brush",
              status = "warning",
              bs4TimelineItemMedia(src = "https://placehold.it/150x100"),
              bs4TimelineItemMedia(src = "https://placehold.it/150x100")
            ),
            bs4TimelineStart(status = "danger")
          )
        ),
        fluidRow(
          bs4Card(
            title = "Stars",
            bs4Stars(grade = 5),
            bs4Stars(grade = 5, status = "success"),
            bs4Stars(grade = 1, status = "danger"),
            bs4Stars(grade = 3, status = "info")
          )
        )
      ),
      bs4TabItem(
        tabName = "gallery2",
        bs4Jumbotron(
          title = "I am a Jumbotron!",
          lead = "This is a simple hero unit, a simple jumbotron-style 
          component for calling extra attention to featured 
          content or information.",
          "It uses utility classes for typography and spacing 
          to space content out within the larger container.",
          status = "primary",
          href = "https://www.google.fr"
        ),
        
        br(),
        
        h4("Rounded Badges"),
        fluidRow(
          bs4Badge(status = "secondary", "blabla", rounded = TRUE),
          bs4Badge(status = "dark", "blabla", rounded = TRUE)
        ),
        
        br(),
        
        h4("BS4 list group"),
        fluidRow(
          bs4ListGroup(
            bs4ListGroupItem(
              type = "basic",
              "Cras justo odio"
            ),
            bs4ListGroupItem(
              type = "basic",
              "Dapibus ac facilisis in"
            ),
            bs4ListGroupItem(
              type = "basic",
              "Morbi leo risus"
            )
          ),
          bs4ListGroup(
            bs4ListGroupItem(
              "Cras justo odio",
              active = TRUE, 
              disabled = FALSE, 
              type = "action",
              src = "https://www.google.fr"
            ),
            bs4ListGroupItem(
              active = FALSE, 
              disabled = FALSE, 
              type = "action",
              "Dapibus ac facilisis in",
              src = "https://www.google.fr"
            ),
            bs4ListGroupItem(
              "Morbi leo risus",
              active = FALSE, 
              disabled = TRUE, 
              type = "action",
              src = "https://www.google.fr"
            )
          ),
          bs4ListGroup(
            bs4ListGroupItem(
              "Donec id elit non mi porta gravida at eget metus. 
              Maecenas sed diam eget risus varius blandit.",
              active = TRUE, 
              disabled = FALSE, 
              type = "heading",
              title = "List group item heading", 
              subtitle = "3 days ago", 
              footer = "Donec id elit non mi porta."
            ),
            bs4ListGroupItem(
              "Donec id elit non mi porta gravida at eget metus. 
              Maecenas sed diam eget risus varius blandit.",
              active = FALSE, 
              disabled = FALSE, 
              type = "heading",
              title = "List group item heading", 
              subtitle = "3 days ago", 
              footer = "Donec id elit non mi porta."
            )
          )
        )
      )
    )
  ),
  controlbar = bs4DashControlbar(
    skin = "light",
    title = "My right sidebar",
    setSliderColor(sliderId = 1, "black"),
    sliderInput("obs", "Number of observations:",
                min = 0, max = 1000, value = 500
    ),
    column(
      width = 12,
      align = "center",
      radioButtons(
        "dist", 
        "Distribution type:",
        c("Normal" = "norm",
          "Uniform" = "unif",
          "Log-normal" = "lnorm",
          "Exponential" = "exp")
      )
    )
  ),
  footer = bs4DashFooter(
    copyrights = a(
      href = "https://twitter.com/divadnojnarg", 
      target = "_blank", "@DivadNojnarg"
    ),
    right_text = "2018"
  ),
  title = "bs4Dash Showcase"
)

server = function(input, output) {
  
  output$plot <- renderPlot({
    hist(rnorm(input$obs))
  })
  
  output$distPlot <- renderPlot({
    dist <- switch(input$dist,
                   norm = rnorm,
                   unif = runif,
                   lnorm = rlnorm,
                   exp = rexp,
                   rnorm)
    
    hist(dist(500))
  })
  
  output$plot2 <- renderPlotly({
    p <- plot_ly(df, x = ~x) %>%
      add_lines(y = ~y1, name = "A") %>%
      add_lines(y = ~y2, name = "B", visible = F) %>%
      layout(
        xaxis = list(domain = c(0.1, 1)),
        yaxis = list(title = "y"),
        updatemenus = list(
          list(
            y = 0.8,
            buttons = list(
              
              list(method = "restyle",
                   args = list("line.color", "blue"),
                   label = "Blue"),
              
              list(method = "restyle",
                   args = list("line.color", "red"),
                   label = "Red"))),
          
          list(
            y = 0.7,
            buttons = list(
              list(method = "restyle",
                   args = list("visible", list(TRUE, FALSE)),
                   label = "Sin"),
              
              list(method = "restyle",
                   args = list("visible", list(FALSE, TRUE)),
                   label = "Cos")))
        )
      )
  })
  
  output$plot3 <- renderPlotly({
    s <- subplot(
      plot_ly(x = x, type = "histogram"),
      plotly_empty(),
      plot_ly(x = x, y = y, type = "histogram2dcontour"),
      plot_ly(y = y, type = "histogram"),
      nrows = 2, heights = c(0.2, 0.8), widths = c(0.8, 0.2), margin = 0,
      shareX = TRUE, shareY = TRUE, titleX = FALSE, titleY = FALSE
    )
    p <- layout(s, showlegend = FALSE)
  })
  
}

runApp(shinyApp(ui = ui, server = server))

insertTab issue

HI
I can't realised how to make insertTab with bs4Dash
My code:

library(shiny)
library(bs4Dash)

ui <-  bs4DashPage(
  sidebar_collapsed = T,
  sidebar = bs4DashSidebar(),
  bs4DashFooter(),
  body = bs4DashBody(
  bs4TabSetPanel( id = "id", side = "left",
                  bs4TabPanel(
                    tabName = "Main",
                    active = TRUE,
                    p("Text"),
                    actionButton("add","ADD")))
))

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

  observeEvent(input$add, {
    insertTab(inputId = "id",
              bs4TabPanel(tabName = "Dynamic"),
              target = "Main"
    )
  })
}

shinyApp(ui, server)

bs4DashSidebar input not refreshing properly

library(shiny)
 library(bs4Dash)
 
 shiny::shinyApp(
   ui = dashboardPage(
     controlbar_collapsed = FALSE,
     controlbar_overlay = TRUE,
     navbar = dashboardHeader(),
     sidebar = dashboardSidebar(inputId = "sidebar"),
     body = dashboardBody(
       actionButton(inputId = "controlbarToggle", label = "Toggle Sidebar")
     )
   ),
   server = function(input, output, session) {
     
     observeEvent(input$sidebar, {
       if (input$sidebar) {
         showModal(modalDialog(
           title = "Alert",
           "The sidebar is opened.",
           easyClose = TRUE,
           footer = NULL
         ))
       }
     })
     
     observeEvent(input$controlbarToggle, {
       updatebs4Sidebar(inputId = "sidebar", session = session)
     })
     
     observe({
       print(input$sidebar)
     })
   }
 )

Content not updated if collapsed = TRUE in Box

Hi,
Thanks for putting bootstrap 4 available for Shiny applications.
I am running the github version. I face a problem with collapsed box.
When I uncollapse the box, the content does not appear. I will try to explore this but if you have an idea and/or a fix, that would be nice.
Below is a reproducible example:

library(shiny)
library(bs4Dash)
ui_test <- function() {
  bs4DashPage(
    title = "Test",
    sidebar = bs4DashSidebar(),
    navbar = bs4DashNavbar(),
    body = bs4DashBody(
      fluidRow(
        bs4Card(
          title = "Closable card with dropdown",
          closable = TRUE,
          width = 6,
          status = "warning",
          solidHeader = FALSE,
          collapsible = TRUE,
          labelText = 1,
          labelStatus = "danger",
          labelTooltip = "Hi Bro!",
          dropdownIcon = "wrench",
          dropdownMenu = dropdownItemList(
            dropdownItem(url = "https://www.google.com", name = "Link to google"),
            dropdownItem(url = "#", name = "item 2"),
            dropdownDivider(),
            dropdownItem(url = "#", name = "item 3")
          ),
          plotOutput("plot")
        ),
        bs4Card(
          title = "Closable card with gradient",
          closable = TRUE,
          width = 6,
          status = "warning",
          solidHeader = FALSE,
          gradientColor = "success",
          collapsible = TRUE,
          collapsed = TRUE,
          plotOutput("distPlot")
        )
      )
    )
  )
}

server_test <- function(input, output,session) {
  output$plot <- renderPlot({hist(cars[,1])})
  output$distPlot <- renderPlot({hist(cars[,2], col = "blue")})
}

shinyApp(ui_test(), server_test)

Resizable cards

Hi. I was wondering, is resizing of the cards possible or planned? Like in shinyjqui. But in shinyjqui the cards do not snap. Thanks. Great package. Ivo.

Implement card widget interface

See

library(shiny)
library(bs4Dash)

card <- bs4Card(
  title = "Closable Box with dropdown", 
  closable = TRUE, 
  maximizable = TRUE,
  width = 12,
  status = "warning", 
  collapsible = TRUE,
  p("Box Content")
)

card[[2]]$children[[1]]$attribs$id <- "target"

shiny::shinyApp(
  ui = bs4DashPage(
    enable_preloader = FALSE,
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(),
    controlbar = bs4DashControlbar(),
    footer = bs4DashFooter(),
    title = "test",
    body = bs4DashBody(
      tags$head(
        tags$script(
          paste0(
            "$(function() {
              Shiny.addCustomMessageHandler('target', function(message) {
                $(target).CardWidget(message);
              });
            });
          "
          )
        )
      ),
      br(),
      actionButton("go", "Go!"),
      selectInput(
        "message", 
        "Select an action", 
        selected = "toggle",
        choices = c(
          "toggle",
          "collapse",
          "expand",
          "toggleMaximize",
          "maximize",
          "minimize",
          "remove"
        )
      ),
      card
    )
  ),
  server = function(input, output, session) {
    observe({
      print(input$collapsed_state)
    })
    observeEvent(input$go, {
      session$sendCustomMessage(type = "target", message = input$message)
    })
  }
)

Sidebar Width ?

Is there a way to define the sidebar width ? (Like in shinydashboard)

Maybe you have an example with custom CSS ?

Sidebar opacity

Hi,

I'm facing this issue with the last version of bs4Dash.

When hovering on the sidebar, it appears but it is transparent although I set opacity = 1.

You can see a screenshot of the app here
image

And here is what I have for sidebar in bs4dashPage :

sidebar = bs4DashSidebar(
    title = "Test",
    skin = "light",
    brandColor = "white",
    opacity = 1,
    elevation = 1,
    status = "default",
    url = "example.com",

    # sidebar
    source(file.path("ui", "sidebar_ui.R"), local = TRUE)$value
  )

Thanks for your help.

id parameter for bs4SidebarMenu?

One feature I used in my previous apps powered by shinydashboard and shinyjs is hiding/showing a particular group of menu items in the sidebar based on a reactive event. I seem to have it mostly working in bs4Dash in which I can toggle the state of any sidebar menu item and a particular sidebar header (provided I wrap it in a div with an id specified). But one quirk is that if the user had one of these tabs selected before it is triggered to be hidden, the UI still show the contents of the tab that is supposed to be hidden. With shinydashboard I could get around this by specifying an id in the call to shinydashboard::sidebarMenu() and be able to update the selected tab using the input object associated with it, similar to this SO question. I tried putting id = "mymenu" in the call to bs4SidebarMenu but it did not expose any input associated with the id. Are there plans to add an id parameter in the future? Or would you recommend a different approach? Below is an example adapted from the gallery app that lets the user hide and show the cards sidebar menu items.

library(shiny)
library(shinyWidgets)
library(shinyjs)
library(bs4Dash)
library(plotly)

# plot 2
x <- seq(-2 * pi, 2 * pi, length.out = 1000)
df <- data.frame(x, y1 = sin(x), y2 = cos(x))

# plot 3
x <- rnorm(200)
y <- rnorm(200)

#shiny::shinyApp(
  ui = bs4DashPage(
    navbar = bs4DashNavbar(
      status = "white",
      "I can write text in the navbar!",
      rightUi = bs4DropdownMenu(
        show = TRUE,
        labelText = "!",
        status = "danger",
        src = "https://www.google.fr",
        bs4DropdownMenuItem(
          text = "message 1",
          date = "today"
        ),
        bs4DropdownMenuItem(
          text = "message 2",
          date = "yesterday"
        )
      )
    ),
    sidebar = bs4DashSidebar(
      skin = "light",
      status = "primary",
      title = "bs4Dash",
      brandColor = "primary",
      url = "https://www.google.fr",
      src = "https://adminlte.io/themes/AdminLTE/dist/img/user2-160x160.jpg",
      elevation = 3,
      opacity = 0.8,
      bs4SidebarMenu(
        #id = "tabs",
        checkboxInput("foo", "Show Item2", TRUE),
        
        # cards
        div(
          id = "cards_header",
          bs4SidebarHeader("Cards")
        ),
        
        bs4SidebarMenuItem(
          "Basic cards",
          tabName = "cards",
          icon = "sliders"
        ),
        bs4SidebarMenuItem(
          "User cards",
          tabName = "usercards",
          icon = "object-ungroup"
        ),
        bs4SidebarMenuItem(
          "Tab cards",
          tabName = "tabcards",
          icon = "picture-o"
        ),
        
        # boxes
        bs4SidebarHeader("Boxes"),
        bs4SidebarMenuItem(
          "Basic boxes",
          tabName = "boxes",
          icon = "desktop"
        ),
        bs4SidebarMenuItem(
          "Value/Info boxes",
          tabName = "valueboxes",
          icon = "suitcase"
        ),
        bs4SidebarHeader("BS4 gallery"),
        bs4SidebarMenuItem(
          HTML(
            paste(
              "Gallery 1", 
              bs4Badge(
                "new", 
                position = "right", 
                status = "danger"
              )
            )
          ),
          tabName = "gallery1",
          icon = "paint-brush"
        ),
        bs4SidebarMenuItem(
          HTML(
            paste(
              "Gallery 2", 
              bs4Badge(
                "!", 
                position = "right", 
                status = "success"
              )
            )
          ),
          tabName = "gallery2",
          icon = "map"
        )
      )
    ),
    body = bs4DashBody(
      useShinyjs(),
      bs4TabItems(
        bs4TabItem(
          tabName = "cards",
          fluidRow(
            bs4Card(
              title = "Closable card with dropdown", 
              closable = TRUE, 
              width = 6,
              status = "warning", 
              solidHeader = FALSE, 
              collapsible = TRUE,
              labelText = 1,
              labelStatus = "danger",
              labelTooltip = "Hi Bro!",
              dropdownIcon = "wrench",
              dropdownMenu = dropdownItemList(
                dropdownItem(url = "https://www.google.com", name = "Link to google"),
                dropdownItem(url = "#", name = "item 2"),
                dropdownDivider(),
                dropdownItem(url = "#", name = "item 3")
              ),
              plotOutput("plot")
            ),
            bs4Card(
              title = "Closable card with gradient", 
              closable = TRUE, 
              width = 6,
              status = "warning", 
              solidHeader = FALSE, 
              gradientColor = "success",
              collapsible = TRUE,
              plotOutput("distPlot")
            ),
            bs4Card(
              title = "Card with solidHeader and elevation", 
              elevation = 4,
              closable = TRUE, 
              width = 6,
              solidHeader = TRUE, 
              status = "primary",
              collapsible = TRUE,
              plot_ly(z = ~volcano) %>% add_surface()
            )
          )
        ),
        bs4TabItem(
          tabName = "usercards",
          fluidRow(
            bs4UserCard(
              src = "https://adminlte.io/themes/AdminLTE/dist/img/user1-128x128.jpg",
              status = "info",
              title = "User card type 1",
              subtitle = "a subtitle here",
              elevation = 4,
              "Any content here"
            ),
            bs4UserCard(
              type = 2,
              src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg",
              status = "success",
              imageElevation = 4,
              title = "User card type 2",
              subtitle = "a subtitle here",
              bs4ProgressBar(
                value = 5,
                striped = FALSE,
                status = "info"
              ),
              bs4ProgressBar(
                value = 5,
                striped = TRUE,
                status = "warning",
                width = "20%"
              )
            )
          )
        ),
        bs4TabItem(
          tabName = "tabcards",
          bs4TabCard(
            title = "A card with tabs",
            elevation = 2,
            width = 8,
            bs4TabPanel(
              tabName = "Tab1",
              active = FALSE,
              "A wonderful serenity has taken possession of my entire soul,
              like these sweet mornings of spring which I enjoy with my
              whole heart. I am alone, and feel the charm of existence in
              this spot, which was created for the bliss of souls like mine.
              I am so happy, my dear friend, so absorbed in the exquisite sense
              of mere tranquil existence, that I neglect my talents. I should be
              incapable of drawing a single stroke at the present moment; and yet
              I feel that I never was a greater artist than now"
            ),
            bs4TabPanel(
              tabName = "Tab2",
              active = TRUE,
              "The European languages are members of the same family.
              Their separate existence is a myth. For science, music,
              sport, etc, Europe uses the same vocabulary. The languages
              only differ in their grammar, their pronunciation and their
              most common words. Everyone realizes why a new common
              language would be desirable: one could refuse to pay expensive
              translators. To achieve this, it would be necessary to have
              uniform grammar, pronunciation and more common words. If several
              languages coalesce, the grammar of the resulting language is
              more simple and regular than that of the individual languages."
            ),
            bs4TabPanel(
              tabName = "Tab3",
              active = FALSE,
              "Lorem Ipsum is simply dummy text of the printing and
              typesetting industry. Lorem Ipsum has been the industry's
              standard dummy text ever since the 1500s, when an unknown
              printer took a galley of type and scrambled it to make a
              type specimen book. It has survived not only five centuries,
              but also the leap into electronic typesetting, remaining
              essentially unchanged. It was popularised in the 1960s with
              the release of Letraset sheets containing Lorem Ipsum passages,
              and more recently with desktop publishing software like Aldus
              PageMaker including versions of Lorem Ipsum."
            )
            )
            ),
        bs4TabItem(
          tabName = "valueboxes",
          h4("Value Boxes"),
          fluidRow(
            bs4ValueBox(
              value = 150,
              subtitle = "New orders",
              status = "primary",
              icon = "shopping-cart",
              href = "#"
            ),
            bs4ValueBox(
              elevation = 4,
              value = "53%",
              subtitle = "New orders",
              status = "danger",
              icon = "cogs"
            ),
            bs4ValueBox(
              value = "44",
              subtitle = "User Registrations",
              status = "warning",
              icon = "sliders"
            ),
            bs4ValueBox(
              value = "53%",
              subtitle = "Bounce rate",
              status = "success",
              icon = "database"
            )
          ),
          h4("Info Boxes"),
          fluidRow(
            bs4InfoBox(
              title = "Messages",
              value = 1410,
              icon = "envelope"
            ),
            bs4InfoBox(
              title = "Bookmarks",
              status = "info",
              value = 240,
              icon = "bookmark"
            ),
            bs4InfoBox(
              title = "Comments",
              gradientColor = "danger",
              value = 41410,
              icon = "comments"
            )
          )
        ),
        bs4TabItem(
          tabName = "boxes",
          fluidRow(
            bs4Box(
              height = "600px",
              title = "Box 1",
              plotlyOutput("plot2")
            ),
            bs4Box(
              height = "600px",
              title = "Box 2",
              plotlyOutput("plot3")
            )
          )
        ),
        bs4TabItem(
          tabName = "gallery1",
          fluidRow(
            bs4Card(
              title = "Accordions",
              footer = tagList(
                h4("There is an accordion in the footer!"),
                bs4Accordion(
                  bs4AccordionItem(
                    id = "item1",
                    title = "Item 1", 
                    status = "danger",
                    "Anim pariatur cliche reprehenderit, enim 
                    eiusmod high life accusamus terry richardson ad 
                    squid. 3 wolf moon officia aute, non cupidatat 
                    skateboard dolor brunch. Food truck quinoa nesciunt 
                    laborum eiusmod. Brunch 3 wolf moon tempor, sunt 
                    aliqua put a bird on it squid single-origin coffee 
                    nulla assumenda shoreditch et. Nihil anim keffiyeh 
                    helvetica, craft beer labore wes anderson cred 
                    nesciunt sapiente ea proident. Ad vegan excepteur 
                    butcher vice lomo. Leggings occaecat craft beer farm-to-table, 
                    raw denim aesthetic synth nesciunt you probably haven't 
                    heard of them accusamus labore sustainable VHS"
                  ),
                  bs4AccordionItem(
                    id = "item2",
                    title = "Item 2", 
                    status = "warning",
                    "Anim pariatur cliche reprehenderit, enim 
                    eiusmod high life accusamus terry richardson ad 
                    squid. 3 wolf moon officia aute, non cupidatat 
                    skateboard dolor brunch. Food truck quinoa nesciunt 
                    laborum eiusmod. Brunch 3 wolf moon tempor, sunt 
                    aliqua put a bird on it squid single-origin coffee 
                    nulla assumenda shoreditch et. Nihil anim keffiyeh 
                    helvetica, craft beer labore wes anderson cred 
                    nesciunt sapiente ea proident. Ad vegan excepteur 
                    butcher vice lomo. Leggings occaecat craft beer farm-to-table, 
                    raw denim aesthetic synth nesciunt you probably haven't 
                    heard of them accusamus labore sustainable VHS"
                  )
                  )
                  )
                  ),
            bs4Card(
              title = "Carousel",
              bs4Carousel(
                id = "mycarousel",
                width = 12,
                bs4CarouselItem(
                  active = TRUE,
                  src = "https://placehold.it/900x500/39CCCC/ffffff&text=I+Love+Bootstrap"
                ),
                bs4CarouselItem(
                  active = FALSE,
                  src = "https://placehold.it/900x500/3c8dbc/ffffff&text=I+Love+Bootstrap"
                ),
                bs4CarouselItem(
                  active = FALSE,
                  src = "https://placehold.it/900x500/f39c12/ffffff&text=I+Love+Bootstrap"
                )
              )
            )
                  ),
          fluidRow(
            bs4Card(
              title = "Progress bars",
              footer = tagList(
                bs4ProgressBar(
                  value = 5,
                  striped = FALSE,
                  status = "info"
                ),
                bs4ProgressBar(
                  value = 5,
                  striped = TRUE,
                  status = "warning",
                  width = "20%"
                )
              ),
              bs4ProgressBar(
                value = 80,
                vertical = TRUE,
                status = "success"
              ),
              bs4ProgressBar(
                value = 100,
                vertical = TRUE,
                striped = TRUE,
                status = "danger",
                height = "80%"
              )
            ),
            bs4Card(
              title = "Alerts",
              elevation = 4,
              bs4Alert(
                title = "Be Careful!",
                status = "danger",
                closable = TRUE,
                width = 12,
                "Danger alert preview. This alert is dismissable. 
                A wonderful serenity has taken possession of my entire soul, 
                like these sweet mornings of spring which 
                I enjoy with my whole heart."
              )
              )
              ),
          fluidRow(
            bs4Card(
              title = "Callouts",
              bs4Callout(
                title = "I am a danger callout!",
                elevation = 4,
                status = "danger",
                width = 12,
                "There is a problem that we need to fix. 
                A wonderful serenity has taken possession of 
                my entire soul, like these sweet mornings of 
                spring which I enjoy with my whole heart."
              )
              ),
            bs4Card(
              title = "Loading State",
              bs4Loading()
            )
              ),
          fluidRow(
            bs4Card(
              title = "Timeline",
              bs4Timeline(
                width = 12,
                reversed = TRUE,
                bs4TimelineEnd(status = "danger"),
                bs4TimelineLabel("10 Feb. 2014", status = "info"),
                bs4TimelineItem(
                  elevation = 4, 
                  title = "Item 1",
                  icon = "gears",
                  status = "success",
                  time = "now",
                  footer = "Here is the footer",
                  "This is the body"
                ),
                bs4TimelineItem(
                  title = "Item 2",
                  border = FALSE
                ),
                bs4TimelineLabel("3 Jan. 2014", status = "primary"),
                bs4TimelineItem(
                  elevation = 2,
                  title = "Item 3",
                  icon = "paint-brush",
                  status = "warning",
                  bs4TimelineItemMedia(src = "https://placehold.it/150x100"),
                  bs4TimelineItemMedia(src = "https://placehold.it/150x100")
                ),
                bs4TimelineStart(status = "danger")
              )
            ),
            bs4Timeline(
              width = 6,
              bs4TimelineEnd(status = "danger"),
              bs4TimelineLabel("10 Feb. 2014", status = "info"),
              bs4TimelineItem(
                elevation = 4, 
                title = "Item 1",
                icon = "gears",
                status = "success",
                time = "now",
                footer = "Here is the footer",
                "This is the body"
              ),
              bs4TimelineItem(
                title = "Item 2",
                border = FALSE
              ),
              bs4TimelineLabel("3 Jan. 2014", status = "primary"),
              bs4TimelineItem(
                elevation = 2,
                title = "Item 3",
                icon = "paint-brush",
                status = "warning",
                bs4TimelineItemMedia(src = "https://placehold.it/150x100"),
                bs4TimelineItemMedia(src = "https://placehold.it/150x100")
              ),
              bs4TimelineStart(status = "danger")
            )
          ),
          fluidRow(
            bs4Card(
              title = "Stars",
              bs4Stars(grade = 5),
              bs4Stars(grade = 5, status = "success"),
              bs4Stars(grade = 1, status = "danger"),
              bs4Stars(grade = 3, status = "info")
            )
          )
          ),
        bs4TabItem(
          tabName = "gallery2",
          bs4Jumbotron(
            title = "I am a Jumbotron!",
            lead = "This is a simple hero unit, a simple jumbotron-style 
            component for calling extra attention to featured 
            content or information.",
            "It uses utility classes for typography and spacing 
            to space content out within the larger container.",
            status = "primary",
            href = "https://www.google.fr"
          ),
          
          br(),
          
          h4("Rounded Badges"),
          fluidRow(
            bs4Badge(status = "secondary", "blabla", rounded = TRUE),
            bs4Badge(status = "dark", "blabla", rounded = TRUE)
          ),
          
          br(),
          
          h4("BS4 list group"),
          fluidRow(
            bs4ListGroup(
              bs4ListGroupItem(
                type = "basic",
                "Cras justo odio"
              ),
              bs4ListGroupItem(
                type = "basic",
                "Dapibus ac facilisis in"
              ),
              bs4ListGroupItem(
                type = "basic",
                "Morbi leo risus"
              )
            ),
            bs4ListGroup(
              bs4ListGroupItem(
                "Cras justo odio",
                active = TRUE, 
                disabled = FALSE, 
                type = "action",
                src = "https://www.google.fr"
              ),
              bs4ListGroupItem(
                active = FALSE, 
                disabled = FALSE, 
                type = "action",
                "Dapibus ac facilisis in",
                src = "https://www.google.fr"
              ),
              bs4ListGroupItem(
                "Morbi leo risus",
                active = FALSE, 
                disabled = TRUE, 
                type = "action",
                src = "https://www.google.fr"
              )
            ),
            bs4ListGroup(
              bs4ListGroupItem(
                "Donec id elit non mi porta gravida at eget metus. 
                Maecenas sed diam eget risus varius blandit.",
                active = TRUE, 
                disabled = FALSE, 
                type = "heading",
                title = "List group item heading", 
                subtitle = "3 days ago", 
                footer = "Donec id elit non mi porta."
              ),
              bs4ListGroupItem(
                "Donec id elit non mi porta gravida at eget metus. 
                Maecenas sed diam eget risus varius blandit.",
                active = FALSE, 
                disabled = FALSE, 
                type = "heading",
                title = "List group item heading", 
                subtitle = "3 days ago", 
                footer = "Donec id elit non mi porta."
              )
            )
          )
        )
            )
              ),
    controlbar = bs4DashControlbar(
      skin = "light",
      title = "My right sidebar",
      setSliderColor(sliderId = 1, "black"),
      sliderInput("obs", "Number of observations:",
                  min = 0, max = 1000, value = 500
      ),
      column(
        width = 12,
        align = "center",
        radioButtons(
          "dist", 
          "Distribution type:",
          c("Normal" = "norm",
            "Uniform" = "unif",
            "Log-normal" = "lnorm",
            "Exponential" = "exp")
        )
      )
    ),
    footer = bs4DashFooter(
      copyrights = a(
        href = "https://twitter.com/divadnojnarg", 
        target = "_blank", "@DivadNojnarg"
      ),
      right_text = "2018"
    ),
    title = "bs4Dash Showcase"
  )
  
  server = function(input, output, session) {
    
    # show/hide the cards menu items 
    observe({
      toggle(condition = input$foo, id = "cards_header")
      toggle(condition = input$foo, selector = "a[data-value=cards]")
      toggle(condition = input$foo, selector = "a[data-value=usercards]")
      toggle(condition = input$foo, selector = "a[data-value=tabcards]")
      
      # I tried setting id = "mymenu" in the call to bs4SidebarMenu but it had no effect
      #newtab <- switch(input$mymenu, "cards" = "boxes", "usercards" = "boxes", "tabcards" = "boxes")
      #updateTabItems(session, "tabs", newtab)
    })
    
    output$plot <- renderPlot({
      hist(rnorm(input$obs))
    })
    
    output$distPlot <- renderPlot({
      dist <- switch(input$dist,
                     norm = rnorm,
                     unif = runif,
                     lnorm = rlnorm,
                     exp = rexp,
                     rnorm)
      
      hist(dist(500))
    })
    
    output$plot2 <- renderPlotly({
      p <- plot_ly(df, x = ~x) %>%
        add_lines(y = ~y1, name = "A") %>%
        add_lines(y = ~y2, name = "B", visible = F) %>%
        layout(
          xaxis = list(domain = c(0.1, 1)),
          yaxis = list(title = "y"),
          updatemenus = list(
            list(
              y = 0.8,
              buttons = list(
                
                list(method = "restyle",
                     args = list("line.color", "blue"),
                     label = "Blue"),
                
                list(method = "restyle",
                     args = list("line.color", "red"),
                     label = "Red"))),
            
            list(
              y = 0.7,
              buttons = list(
                list(method = "restyle",
                     args = list("visible", list(TRUE, FALSE)),
                     label = "Sin"),
                
                list(method = "restyle",
                     args = list("visible", list(FALSE, TRUE)),
                     label = "Cos")))
          )
        )
    })
    
    output$plot3 <- renderPlotly({
      s <- subplot(
        plot_ly(x = x, type = "histogram"),
        plotly_empty(),
        plot_ly(x = x, y = y, type = "histogram2dcontour"),
        plot_ly(y = y, type = "histogram"),
        nrows = 2, heights = c(0.2, 0.8), widths = c(0.8, 0.2), margin = 0,
        shareX = TRUE, shareY = TRUE, titleX = FALSE, titleY = FALSE
      )
      p <- layout(s, showlegend = FALSE)
    })
    
  }

  runApp(shinyApp(ui = ui, server = server))

Conditional elements in sidebar?

I was trying to use a conditionalPanel(), as such:

bs4SidebarMenuItem(
  "About this App",
  tabName = "home",
  icon = "home"
),

# Modules
bs4SidebarHeader("Modules"),

# Dicentrics
conditionalPanel(
  bs4SidebarMenuItem(
  condition = "input.experiment_select == 'Dicentrics'",
    "Fitting",
    tabName = "tab-dicent-fitting",
    icon = "cog"
  )
)

to have dynamic elements on my sidebar. The issue is that once they are clicked, the conditional elements/tabs remain active no matter what, and thus, can't be clicked again.

After starting the Shiny:
image

After clicking both conditional tabs:
image

The non-conditional tab can be triggered/accessed again with no issues:
image

Maybe there is some way to modify the bs4SidebarMenuItem() function itself to have a condition argument?

info box icons are not rendering (several icons can render but not all)

library(shiny)
library(bs4Dash)

 shiny::shinyApp(
   ui = bs4DashPage(
     navbar = bs4DashNavbar(),
     sidebar = bs4DashSidebar(),
     controlbar = bs4DashControlbar(),
     footer = bs4DashFooter(),
     title = "test",
     body = bs4DashBody(
      fluidRow(
       bs4InfoBox(
        title = "Messages",
        iconStatus = "success",
        value = 1410,
        icon = "envelope-o"
       ),
       bs4InfoBox(
        title = "Bookmarks",
        status = "info",
        value = 240,
        icon = "bookmark-o"
       ),
       bs4InfoBox(
        title = "Comments",
        gradientColor = "danger",
        value = 41410,
        icon = "comments-o"
       )
      )
     )
   ),
   server = function(input, output) {}
 )

navbar dark skin causes sidebar toggle icons disappear ( only "light" works)

library(shiny)
library(bs4Dash)
 
 shiny::shinyApp(
   ui = bs4DashPage(
     navbar = bs4DashNavbar(
      skin = "dark",
      rightUi = bs4DropdownMenu(
       show = TRUE,
       labelText = "!",
       status = "danger",
       src = "http://www.google.fr",
       bs4DropdownMenuItem(
        text = "message 1",
        date = "today"
       ),
       bs4DropdownMenuItem(
        text = "message 2",
        date = "yesterday"
       )
      )
     ),
     sidebar = bs4DashSidebar(),
     controlbar = bs4DashControlbar(),
     footer = bs4DashFooter(),
     title = "test",
     body = bs4DashBody()
   ),
   server = function(input, output) {}
 )

Creating a card minimized does not display uiOutput when maximized

Running version 0.3.0 of bs4Dash.

In attached code, if the card is created with collapsed = FALSE, the card is created and the output is displayed. If however, collapsed = TRUE, then the card is created in collapsed mode; however, when the card is maximized, the output is not displayed.

library(shiny)
library(bs4Dash)

shiny::shinyApp(
  ui = bs4DashPage(
    old_school = FALSE,
    sidebar_collapsed = FALSE,
    controlbar_collapsed = FALSE,
    title = "Basic Dashboard",
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(),
    controlbar = bs4DashControlbar(),
    footer = bs4DashFooter(),
    body = bs4DashBody(
      bs4Card(
        title = "item1",
        collapsed = FALSE,
        uiOutput(outputId = "will_this_run")
      )
    )
  ),
  server = function(input, output) {
    output$will_this_run <- renderUI({
      p("It Ran")
    })
  }
)

Add side argument in bs4TabCard

In a bs4TabCard, the tabs are only displayed on the right side.
Would it be possible to have a side argument like in shinydashboard::tabBox() ?

bs4TabPanel tabName does not accept space

I cannot set a tab name with space inside bs4TabPanel .
The content of the second tab is not updated :

library(shiny)
library(bs4Dash)

shinyApp(
  ui = bs4DashPage(
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(
      bs4SidebarMenuItem(
        "Tabs",
        tabName = "tabs"
      )
    ),
    body = bs4DashBody(
      bs4TabItems(
        bs4TabItem(
          tabName = "tabs",
          bs4TabCard(
            bs4TabPanel(
              tabName = "tab name 1",
              active = TRUE,
              "text 1"
            ),
            bs4TabPanel(
              tabName = "tab name 2",
              "text 2"
            )
          )
        )
      )
    )
  ),
  server = function(input, output) {}
)

But it works with a tabPanel in shinydashboard :

library(shiny)
library(shinydashboard)

shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(),
    sidebar = bs4DashSidebar(
      sidebarMenu(
        menuSubItem(
          "Tabs",
          tabName = "tabs"
        )
      )
    ),
    body = dashboardBody(
      tabItems(
        tabItem(
          tabName = "tabs",
          tabBox(
            tabPanel(
              title = "tab name 1",
              "text 1"
            ),
            tabPanel(
              title = "tab name 2",
              "text 2"
            )
          )
        )
      )
    )
  ),
  server = function(input, output) {}
)

dynamically render bs4TabPanel in a bs4TabCard

Hi!,

I'm trying to apply an example I found in shiny to the bs4Dash package.

The setup is to create a dynamic amount of bs4TabPanels inside a bs4TabCard according to a numericInput.

After some careful googling, I've the following:

library(bs4Dash)
library(shiny)

#UI
ui <- dashboardPage(
                    dashboardHeader(),
                    dashboardSidebar(numericInput('no','N',2)),
                    dashboardBody(uiOutput("tabs"))
                    )

#Server
server <- function(input, output, session) {
  output$tabs <- renderUI({
    no <- input$no
    tabs <- lapply(1:no, function(i) {
      id <- paste0("tab", i)
      bs4TabPanel(
        tabName = paste("Tab Title",i) )
      
    })
    args <- c(tabs, list(id = "box") )
    do.call(bs4TabCard, args)
  })
}

#Run
shinyApp(ui, server)

My issue is that I cannot get another component to appear after the uiOutput (e.g. another bs4TabCard I want to manually set). Any guidance is appreciated!

shinyFiles not rendering with bs4Dash

I like to use the excellent shinyFiles package in my shiny applications to let the user browse for files stored on server, and I noticed that I cannot get the typical shinyFiles dialog window to appear within a bs4Dash app. A simple reprex is below. Basically when you click the button to bring up the dialog, nothing happens. I don't see any messages appear in the R console after the button press, so I was not able to track down any helpful debugging information.

Here's the real 🤔 : If I use your awesome shinydashboardPlus package, then shinyFiles works without issue. A reprex for that case is below as well. I'm happy to assist with any additional debugging if you want more information.

shinyFiles with bs4Dash

library(shiny)
library(bs4Dash)
# devtools::install_github("thomasp85/shinyFiles")
library(shinyFiles)

shiny::shinyApp(
  ui = bs4DashPage(
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(),
    controlbar = bs4DashControlbar(),
    footer = bs4DashFooter(),
    title = "Basic Dashboard",
    body = bs4DashBody(
      h1("shinyFiles Demo"),
      shinyFilesButton("file", "File select", "Please select a file", FALSE)
    )
  ),
  
  
  server = function(input, output, session) {
    
    volumes <- c("R Installation" = R.home())
    shinyFileChoose(input, "file",
                    roots = volumes, session = session, restrictions = system.file(package = "base"),
                    defaultRoot = "R Installation", defaultPath = "library"
    )
  }
)

shinyFiles with shinydashboardPlus

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
# devtools::install_github("thomasp85/shinyFiles")
library(shinyFiles)

shiny::shinyApp(
  ui = dashboardPagePlus(
    dashboardHeaderPlus(),
    dashboardSidebar(),
    dashboardBody(
      h1("shinyFiles Demo"),
      shinyFilesButton("file", "File select", "Please select a file", FALSE)
    )
  ),
  
  
  server = function(input, output, session) {
    
    volumes <- c("R Installation" = R.home())
    shinyFileChoose(input, "file",
                    roots = volumes, session = session, restrictions = system.file(package = "base"),
                    defaultRoot = "R Installation", defaultPath = "library"
    )
  }
)

No right border on collapsed sidebar menu items

For some reason, the collapsed sidebar items render as expected on RStudio:
image

While on Chrome (72.0.3626.121) and Firefox (65.0.2) the right side of the sidebar items is extended till the right border of the sidebar:
image

Any way to fix this? I've been inspecting the CSS code and haven't found any fix so far.

Compatibility with shinyWidgets pickerInput

I use the pickerInput from shinyWidget but the choices are not displayed with bs4Dash :

library(shiny)
library(shinyWidgets)
library(bs4Dash)

shiny::shinyApp(
  ui = bs4DashPage(
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(),
    body = bs4DashBody(
      bs4TabItems(
        bs4TabItem(
          tabName = "test",
          fluidRow(
            pickerInput("test", "Test", multiple = TRUE, choices = c("Choice 1", "Choice 2")
            )
          )
        )
      )
    )
  ),
  server = function(input, output, session) {
    
  }
)

Here is my session info :

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252    LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C                   LC_TIME=French_France.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] bindrcpp_0.2.2     bs4Dash_0.2.0      shinyWidgets_0.4.3 shiny_1.1.0        magrittr_1.5      

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.18             rstudioapi_0.7           bindr_0.1.1              tidyselect_0.2.4        
 [5] xtable_1.8-3             R6_2.2.2                 rlang_0.2.2              dplyr_0.7.6             
 [9] tools_3.5.1              htmltools_0.3.6          yaml_2.2.0               digest_0.6.17           
[13] assertthat_0.2.0         tibble_1.4.2             crayon_1.3.4             ip.resultats.shiny_0.1.0
[17] purrr_0.2.5              later_0.7.5              promises_1.0.1           glue_1.3.0              
[21] mime_0.5                 compiler_3.5.1           pillar_1.3.0             jsonlite_1.5            
[25] httpuv_1.4.5             pkgconfig_2.0.2         

Suggestion on Sidebar open on hover

Sometimes, I inadvertently open the sidebar. It would be nice if I could use the bars in the control bar to open or close the sidebar. Remove the open on hover.

Overall, I love these UI elements and the work you have done here .

Thank you.

card-header status colour partially fails

image

On left and right, the code is exactly the same. The only difference is that the background color of the main card is set or not.
The problem is that header colours of "sub" cards, seems to inherit from the main card when there is no background set, but not for all: See headers on the right are green but should be blue or red.
Can't we define a default "status" for white and/or transparent ? However, I do not get why the red is not red, but the yellow is yellow...

Below the reprex:

library(shiny)
library(bs4Dash)
ui_test <- function() {
  bs4DashPage(
    title = "Test",
    sidebar = bs4DashSidebar(),
    navbar = bs4DashNavbar(),
    body = bs4DashBody(
      fluidRow(
        bs4Card(
          title = "Closable card with dropdown",
          closable = TRUE,
          width = 6,
          status = "success",
          gradientColor = "success",
          bs4Card(
            title = "Closable card with dropdown",
            closable = TRUE,
            width = 6,
            status = "warning",
            solidHeader = FALSE,
            collapsible = TRUE,
            dropdownMenu = dropdownItemList(
              dropdownItem(url = "https://www.google.com", name = "Link to google"),
              dropdownItem(url = "#", name = "item 2"),
              dropdownDivider(),
              dropdownItem(url = "#", name = "item 3")
            ),
            plotOutput("plot")
          ),
          bs4Card(
            title = "Closable card with gradient",
            closable = TRUE,
            width = 6,
            status = "primary",
            solidHeader = FALSE,
            gradientColor = NULL,
            collapsible = TRUE,
            collapsed = FALSE,
            plotOutput("distPlot")
          ),
          bs4Card(
            title = "Closable card with gradient 2",
            closable = TRUE,
            width = 6,
            status = "danger",
            solidHeader = FALSE,
            gradientColor = "danger",
            collapsible = TRUE,
            collapsed = FALSE,
            plotOutput("distPlot2")
          )
        ),
        # right column ----
        bs4Card(
          title = "Closable card with dropdown",
          closable = TRUE,
          width = 6,
          status = "success",
          gradientColor = NULL,
          bs4Card(
            title = "Closable card with dropdown",
            closable = TRUE,
            width = 6,
            status = "warning",
            solidHeader = FALSE,
            collapsible = TRUE,
            dropdownMenu = dropdownItemList(
              dropdownItem(url = "https://www.google.com", name = "Link to google"),
              dropdownItem(url = "#", name = "item 2"),
              dropdownDivider(),
              dropdownItem(url = "#", name = "item 3")
            ),
            plotOutput("right_plot")
          ),
          bs4Card(
            title = "Closable card with gradient",
            closable = TRUE,
            width = 6,
            status = "primary",
            solidHeader = FALSE,
            gradientColor = NULL,
            collapsible = TRUE,
            collapsed = FALSE,
            plotOutput("right_distPlot")
          ),
          bs4Card(
            title = "Closable card with gradient 2",
            closable = TRUE,
            width = 6,
            status = "danger",
            solidHeader = FALSE,
            gradientColor = "danger",
            collapsible = TRUE,
            collapsed = FALSE,
            plotOutput("right_distPlot2")
          )
        )
      )
    )
  )
}

server_test <- function(input, output,session) {
  output$plot <- renderPlot({hist(cars[,1])})
  output$distPlot <- renderPlot({hist(cars[,2], col = "blue")})
  output$distPlot2 <- renderPlot({hist(cars[,2], col = "red")})
  # right
  output$right_plot <- renderPlot({hist(cars[,1])})
  output$right_distPlot <- renderPlot({hist(cars[,2], col = "blue")})
  output$right_distPlot2 <- renderPlot({hist(cars[,2], col = "red")})
}

shinyApp(ui_test(), server_test)

Suggestions to make infoBox clickable?

I want to click the infoBox and redirect the user to another tab, or generate a modal. Any suggestions on how I can make a button on infoBox? Placing a button inside the infoBox as an element ruins the symmetry with non-button ones.

image

bs4DashSidebar() - menu isn't collapsed on screen resize

My environment it detailed below but I installed bs4Dash using:

install.packages("bs4Dash")

And I'm facing this issue when using bs4DashSidebar() and resize my screen.

Here an little image to demonstrate that:

gif-sidebar

               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          5.3                         
year           2019                        
month          03                          
day            11                          
svn rev        76217                       
language       R                           
version.string R version 3.5.3 (2019-03-11)
nickname       Great Truth 

Any ideas? Thanks

bs4TabCard() only shows content of the last card if there is a plotlyOutput

Initially I thought this could be a problem with the latest shiny 1.4 version. However, I could just break down a little bit more the problem, and it seems that plotly is causing such weird behavior.

The problem is that if there is a plotly::plotyOutput it renders the content of the last tab on all the tabs. If I switch back to plotOutput it works.

Note: I am not sure it matters much, but I am using bs4Dash@updateAdminLTE.

Reprex that works
library(shiny)
library(bs4Dash)
library(ggplot2)

card <- bs4TabCard(
    id = "tabcard",
    title = "Graphs",
    side = "right",
    elevation = 4,
    width = 12,
    status = "warning",
    tabStatus = c("dark", "danger"),
    maximizable = TRUE,
    collapsible = TRUE, 
    closable = FALSE,
    
    bs4TabPanel(
        tabName = "Graph 1",
        active = TRUE,
        plotOutput("graph_1")
    ),
    
    bs4TabPanel(
        tabName = "Graph 2",
        active = FALSE,
        plotOutput("graph_2")
    ),
    
    bs4TabPanel(
        tabName = "Graph 3",
        active = FALSE,
        plotOutput("graph_3")
    )
)

shiny::shinyApp(
    ui = bs4DashPage(
        enable_preloader = FALSE,
        sidebar_collapsed = TRUE,
        navbar = bs4DashNavbar(),
        sidebar = bs4DashSidebar(),
        controlbar = bs4DashControlbar(),
        footer = bs4DashFooter(),
        title = "test",
        body = bs4DashBody(
            card
        )
    ),
    server = function(input, output, session) {
        
        output$graph_1 <- renderPlot({
            ggplot(mtcars, aes(mpg, cyl)) +
                geom_point()
        })
        
        output$graph_2 <- renderPlot({
            ggplot(mtcars, aes(wt, drat)) +
                geom_point()
        })
        
        output$graph_3 <- renderPlot({
            ggplot(mtcars, aes(wt, hp)) +
                geom_point()
        })
    }
)
Reprex that doesn't work
library(shiny)
library(bs4Dash)
library(ggplot2)
library(plotly)

card <- bs4TabCard(
    id = "tabcard",
    title = "Graphs",
    side = "right",
    elevation = 4,
    width = 12,
    status = "warning",
    tabStatus = c("dark", "danger"),
    maximizable = TRUE,
    collapsible = TRUE, 
    closable = FALSE,
    
    bs4TabPanel(
        tabName = "Graph 1",
        active = TRUE,
        plotlyOutput("graph_1")
    ),
    
    bs4TabPanel(
        tabName = "Graph 2",
        active = FALSE,
        plotlyOutput("graph_2")
    ),
    
    bs4TabPanel(
        tabName = "Graph 3",
        active = FALSE,
        plotlyOutput("graph_3")
    )
)

shiny::shinyApp(
    ui = bs4DashPage(
        enable_preloader = FALSE,
        sidebar_collapsed = TRUE,
        navbar = bs4DashNavbar(),
        sidebar = bs4DashSidebar(),
        controlbar = bs4DashControlbar(),
        footer = bs4DashFooter(),
        title = "test",
        body = bs4DashBody(
            card
        )
    ),
    server = function(input, output, session) {
        
        output$graph_1 <- renderPlotly({
            ggplot(mtcars, aes(mpg, cyl)) +
                geom_point()
        })
        
        output$graph_2 <- renderPlotly({
            ggplot(mtcars, aes(wt, drat)) +
                geom_point()
        })
        
        output$graph_3 <- renderPlotly({
            ggplot(mtcars, aes(wt, hp)) +
                geom_point()
        })
    }
)


Session Info
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.6.1 (2019-07-05)
 os       Ubuntu 19.04                
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       Europe/Berlin               
 date     2019-10-11                  

─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package         * version     date       lib source                               
 assertthat        0.2.1       2019-03-21 [1] CRAN (R 3.6.0)                       
 backports         1.1.5       2019-10-02 [1] CRAN (R 3.6.1)                       
 bs4Dash         * 0.5.0.9000  2019-09-03 [1] Github (RinteRface/bs4Dash@53d821e)  
 Cairo             1.5-10      2019-03-28 [1] CRAN (R 3.6.0)                       
 cli               1.1.0       2019-03-19 [1] CRAN (R 3.6.0)                       
 colorspace        1.4-1       2019-03-18 [1] CRAN (R 3.6.0)                       
 crayon            1.3.4       2017-09-16 [3] CRAN (R 3.5.0)                       
 crosstalk         1.0.0       2016-12-21 [3] CRAN (R 3.5.1)                       
 data.table        1.12.4      2019-10-03 [1] CRAN (R 3.6.1)                       
 digest            0.6.21      2019-09-20 [1] CRAN (R 3.6.1)                       
 dplyr             0.8.3.9000  2019-10-10 [1] Github (tidyverse/dplyr@dcfc1d1)     
 fastmap           1.0.1       2019-10-08 [1] CRAN (R 3.6.1)                       
 ggplot2         * 3.2.1       2019-08-10 [1] CRAN (R 3.6.1)                       
 glue              1.3.1       2019-03-12 [1] CRAN (R 3.6.0)                       
 gtable            0.3.0       2019-03-25 [1] CRAN (R 3.6.0)                       
 htmltools         0.4.0.9000  2019-10-11 [1] Github (rstudio/htmltools@8ed21e2)   
 htmlwidgets       1.5.1.9000  2019-10-11 [1] Github (ramnathv/htmlwidgets@5b44e2a)
 httpuv            1.5.2.9000  2019-10-06 [1] Github (rstudio/httpuv@57e1d71)      
 httr              1.4.1       2019-08-05 [1] CRAN (R 3.6.1)                       
 jsonlite          1.6         2018-12-07 [3] CRAN (R 3.5.1)                       
 labeling          0.3         2014-08-23 [3] CRAN (R 3.5.0)                       
 later             1.0.0       2019-10-04 [1] CRAN (R 3.6.1)                       
 lazyeval          0.2.2       2019-03-15 [1] CRAN (R 3.6.0)                       
 lifecycle         0.1.0       2019-08-01 [1] CRAN (R 3.6.1)                       
 magrittr          1.5         2014-11-22 [3] CRAN (R 3.5.0)                       
 mime              0.7         2019-06-11 [1] CRAN (R 3.6.0)                       
 munsell           0.5.0       2018-06-12 [3] CRAN (R 3.5.0)                       
 packrat           0.5.0       2018-11-14 [1] CRAN (R 3.6.0)                       
 pillar            1.4.2       2019-06-29 [1] CRAN (R 3.6.0)                       
 pkgconfig         2.0.3       2019-09-22 [1] CRAN (R 3.6.1)                       
 plotly          * 4.9.0.9000  2019-10-10 [1] Github (ropensci/plotly@4c0c7d8)     
 promises          1.1.0.9000  2019-10-06 [1] Github (rstudio/promises@8222809)    
 purrr             0.3.2       2019-03-15 [1] CRAN (R 3.6.0)                       
 R6                2.4.0       2019-02-14 [3] CRAN (R 3.5.2)                       
 Rcpp              1.0.2       2019-07-25 [1] CRAN (R 3.6.1)                       
 rlang             0.4.0.9004  2019-10-10 [1] Github (r-lib/rlang@a7d8177)         
 rstudioapi        0.10.0-9002 2019-10-10 [1] Github (rstudio/rstudioapi@6e340b4)  
 scales            1.0.0       2018-08-09 [3] CRAN (R 3.5.1)                       
 sessioninfo       1.1.1       2018-11-05 [1] CRAN (R 3.6.0)                       
 shiny           * 1.4.0       2019-10-10 [1] CRAN (R 3.6.1)                       
 shinycssloaders   0.2.0       2017-05-12 [1] CRAN (R 3.6.0)                       
 tibble            2.1.3       2019-06-06 [1] CRAN (R 3.6.0)                       
 tidyr             1.0.0       2019-09-11 [1] CRAN (R 3.6.1)                       
 tidyselect        0.2.5       2018-10-11 [3] CRAN (R 3.5.1)                       
 vctrs             0.2.0.9005  2019-10-11 [1] Github (r-lib/vctrs@9854f71)         
 viridisLite       0.3.0       2018-02-01 [3] CRAN (R 3.5.0)                       
 withr             2.1.2       2018-03-15 [3] CRAN (R 3.5.0)                       
 xtable            1.8-4       2019-04-21 [1] CRAN (R 3.6.0)                       
 yaml              2.2.0       2018-07-25 [3] CRAN (R 3.5.1)                       
 zeallot           0.1.0       2018-01-28 [1] CRAN (R 3.6.0)      

uiOutput not working when nested in more than two bs4dash containers

Here's a version to show the issue I come across working on a bigger app. What I noticed is that when uiOutput is inside more than two bs4Dash containers it wouldn't render the ui. If I replace bas4TabCard with column, the ui works, but I cannot do that in the app I'm working on. Are there other solutions?

ui <- bs4DashPage(
  
  bs4DashNavbar(),
  
  bs4DashSidebar(),
  
  bs4DashBody(
    bs4TabCard(
      id = "tabcard",
      column(width = 12,
             id = "df",
             bs4TabSetPanel(
               id = "digital",
               side="left",
               bs4TabPanel(width = 6,
                           tabName = 'test',
                           uiOutput("try")
               )
             )
      ))
  ))


server <- function(input, output){
  print("test")
  output$try <- renderUI ({
    print("try")
    column(
      width = 12,
      selectInput(
        inputId = "digital_pathway_insights_channel",
        label = "Choices",
        choices = c("a", "b", "c")
      )
    )
  })
}


shinyApp(ui=ui, server=server)

navbar status makes icons disappear when different of "white" or "grey"

library(shiny)
library(bs4Dash)
 
 shiny::shinyApp(
   ui = bs4DashPage(
     navbar = bs4DashNavbar(
      status = "primary",
      rightUi = bs4DropdownMenu(
       show = TRUE,
       labelText = "!",
       status = "danger",
       src = "http://www.google.fr",
       bs4DropdownMenuItem(
        text = "message 1",
        date = "today"
       ),
       bs4DropdownMenuItem(
        text = "message 2",
        date = "yesterday"
       )
      )
     ),
     sidebar = bs4DashSidebar(),
     controlbar = bs4DashControlbar(),
     footer = bs4DashFooter(),
     title = "test",
     body = bs4DashBody()
   ),
   server = function(input, output) {}
 )

bs4dash controlbar icon still displaying while set to NULL

Hello,

The little icon of the controlbar is still there although I've set controlbar = NULL.

Is there a way to remove it as it's there but we can't even click on it.

Screen Shot 2019-04-24 at 12 51 51

I've found in the example here that they found a way to remove it once the app has been loaded, but I don't know how.

Thanks a lot

Jumbotron feature

Thanks a lot for this package!

is it possible to add options in bs4Jumbotron() for customization "More" button? I mean rename it, or hide, or for example get event from this button in shiny app (input$bs4Jumbotron)

Accordion with no items throws an error

When bs4Accordion is called without any items the following error occurs.

Error in `*tmp*`[[i]] : subscript out of bounds
Called from: FUN(X[[i]], ...)

Reproducible in the following application:

library(shiny)
library(bs4Dash)

ui <- bs4DashPage(
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(),
    controlbar = bs4DashControlbar(),
    footer = bs4DashFooter(),
    title = "test",
    body = bs4DashBody(
        bs4Accordion(id = "accordion")
    )
)
server <- function(input, output) {}

shinyApp(ui = ui, server = server)

Updgrade bootstrap to 4.3.1

Is there a millstone in the road map where there is planned to upgrade the bootstrap 4 version to 4.3.1? There are some bugs related to the current version that has been removed in the latest release. I have tested with the new version of bootstrap with bs4dash and haven’t found any major changes. Anyway 4.3.1 fixed my bug in regard to opening modal boxes in windows given bug message: "Object.keys: argument is not an object" which is a bug marked in current version used by bs4Dash

id parameter for bs4TabSetPanel?

Hi,

Similar to #8, it would be fantastic if bs4TabSetPanel would have an id parameter so that we can detect which bs4TabPanel is currently active and trigger events (like ://stackoverflow.com/questions/23243454/how-to-use-tabpanel-as-input-in-r-shiny).

Are there plans to add an id parameter to bs4TabSetPanel as well in the future?

Thanks for the awesome work on bs4Dash!

Julien

Programmatic way to close the "closable" elements?

I've been having a lot of fun exploring the awesome collection of UI elements in the package, and my apps are already becoming much more intuitive to my users!

One element I've been using more often is bs4Alert() (see screen grab below). It would be great to have a way to automatically close the alert based on some action in the app or by the user, somewhat like how shiny::removeModal() can remove a Shiny modal. I could do some hacks with shinyjs to wrap the alert in a div and hide it based on some event (like hitting that load data button in the example), but a more native solution would make things a lot easier on my side. Feel free to close if this is not relevant to the package.

Screen Shot 2019-04-10 at 1 55 17 PM

icons

Hi

How can i find the list of icons available and create new ones if there isn't a suitable one?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.