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)
}
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;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With