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

Hide text in sidebar when collapsed #140

Open
racheldsoh opened this issue May 27, 2021 · 1 comment
Open

Hide text in sidebar when collapsed #140

racheldsoh opened this issue May 27, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@racheldsoh
Copy link

Hi, I've added some HTML texts to the left sidebar and I would like the text to disappear when the sidebar is collapsed (otherwise it doesn't show properly). Is there a way to do that?

See the information section in the sidebar below.

Screenshot 2021-05-27 at 11 18 41 AM

@DivadNojnarg DivadNojnarg added the enhancement New feature or request label Sep 15, 2021
@etiennebacher
Copy link

You can use shinyjs to do this:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(shinyjs)

shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(),
    sidebar = dashboardSidebar(
      id = "sidebar",
      p("hello this is some text that just serves as a reprex", id = "info")
    ),
    body = dashboardBody(
      useShinyjs()
    )
  ),
  server = function(input, output, session) {
    observeEvent(input$sidebar, {
      toggle("info")
    })
    
  }
)

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

No branches or pull requests

3 participants