1

I'm using prettyCheckboxGroup from shinyWidgets within a sidebar panel in Shiny. Some of the items are unavoidably a bit long and so they extend out of the edge of the sidebar.

I'd like to know how to either wrap long text or limit the width for text to force it on to the next line.

I assumed that the width argument would achieve this but it only seems to effect the caption and not the choices text.

The standard checkboxGroupInput did this as standard so I'm wondering if I am missing something with the fancier ShinyWidgets version?

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  sidebarPanel(
    width = 2,
    uiOutput('boxpick')
  )
)

server<- function(input, output) {
  output$boxpick <- renderUI(
    prettyCheckboxGroup('boxpick', 'Pick an item:',
                       choices= c('really really long', 
                                  'really really really really long',
                                  'really really really really really really really really long')
                       )
  )
}

shinyApp(ui,server)
r0bt
  • 383
  • 3
  • 12

0 Answers0