Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

shinydashboard Sidebar Menu Overflow

Is there any way to fit some sort of text on shinydashboard with word wrap? The default behaviour seems to be for it to spill over into the body area.

I would like to avoid modifying css directly however if there is a workaround which involves modifying CSS as part of the server / ui code itself then I'm open to that.

ui <- dashboardPage(
   dashboardHeader(
      title = "Sidebar spill"

   ),
   dashboardSidebar(
      sidebarMenu(
         menuItem(text = "sfsdf sfaosh oas fwue wi aseiu wehw wuer woeur owuer  ")
         )
      ),
   dashboardBody(
      fluidRow(

      )
   )
)

server <- function(input, output) {

}

shinyApp(ui, server)
}
like image 831
TheComeOnMan Avatar asked Dec 17 '15 13:12

TheComeOnMan


1 Answers

The file "AdminLTE.min.css" (this version of it anyway in this version of Shinydashboard) specifies "white-space: nowrap !important" for the "sidebar-menu" class as well as "li" elements with class "header" that are direct descendents of elements with the "sidebar-menu" class. I saw that the "li" elements in the sidebar menu of my Shinydashboard application do not have the "header" class, so I overrode "white-space: nowrap !important" (that was being applied because the "ul" element containing the menu is of class "sidebar-menu") by adding the following CSS to a custom CSS file:

.sidebar-menu > li {
    white-space: normal;
}
like image 181
Nah Avatar answered Oct 11 '22 19:10

Nah