Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace header title with an icon when minified = TRUE, #157

Open
JianWang2016 opened this issue Dec 28, 2021 · 1 comment
Open

replace header title with an icon when minified = TRUE, #157

JianWang2016 opened this issue Dec 28, 2021 · 1 comment

Comments

@JianWang2016
Copy link

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.

@etiennebacher
Copy link

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants