line break in actionButton title in a shiny gadget

I believe this used to work with previous version of shiny but I'm having trouble getting a title for an actionButton to use linebreaks.

The approach mentioned in Shiny: break line in button label (Solved) does not seem to work for the button title but \n for a new line does work.

library(shiny)
shinyApp(
  ui = fluidPage(
    actionButton("btnId1", "Button 1", title = HTML("I want a line break here <br/> since the title is too long")),
    actionButton("btnId2", "Button 2", title = "I want a\nline break here\nsince the title\nis too long")
  ),
  server = function(input, output){}
)

However for a shiny gadget neither \n nor the approach mentioned in Shiny: break line in button label (Solved) not seem to work for the button title. Any suggestions?

library(shiny)
library(miniUI)

ui <- miniPage(
  gadgetTitleBar("My Gadget"),
  miniContentPanel(
    actionButton("btnId1", "Button 1", title = HTML("I want a line break here <br/> since the title is too long")),
    actionButton("btnId2", "Button 2", title = "I want a\nline break here\nsince the title\nis too long")
  )
)

server <- function(input, output, session) {
  observeEvent(input$done, {
    stopApp()
  })
}
  
runGadget(ui, server)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.