shinydashboardPlus icon indicating copy to clipboard operation
shinydashboardPlus copied to clipboard

replace header title with an icon when minified = TRUE,

Open JianWang2016 opened this issue 2 years ago • 1 comments

Hi,

The header title is replaced with an icon in the shinydashboardPlusDemo app https://dgranjon.shinyapps.io/shinydashboardPlusDemo/. Two quick questions:

  1. Is the code for shinydashboardPlusDemo available somewhere?
  2. if not, how to achieve the same?

Thanks much.

JianWang2016 avatar Dec 28 '21 20:12 JianWang2016

The code of the demo is here. Basically, the code to have alternatively a logo and a title is:

library(shiny)
library(shinydashboardPlus)

shinyApp(
  ui = tagList(
    dashboardPage(
      options = list(sidebarExpandOnHover = TRUE),
      header = dashboardHeader(
        title = tagList(
          span(class = "logo-lg", "shinydashboardPlus"), 
          img(
            src = "https://www.rstudio.com/wp-content/uploads/2014/04/dplyr.png",
            style = "width: 35px"
          )
        )
      ),
      sidebar = dashboardSidebar(
        id = "sidebar"
      ),
      body = shinydashboard::dashboardBody(),
      title = "DashboardPage"
    )
  ),
  server = function(input, output) {}
)

The important part here is class = "logo-lg".

etiennebacher avatar Apr 30 '22 12:04 etiennebacher