Reputation: 11676
I want to have an infobox show text over two lines. For example, if I were to combine html and and shiny (like one does for the popups in leaflet):
output$myInfoBox <- renderInfoBox({infobox(paste("Output1: ", myout1, "<br>", "Output2: ", myout2, sep = ""))})
I've tried "<br>", "\n"
, etc. Nothing works.
Thanks!
Upvotes: 4
Views: 4849
Reputation: 131
I was struggling with this as well. The solution I found is to use the shiny HTML() function which explicitly marks text as HTML to avoid escaping.
For example, if you execute infoBox("test_id",paste("test_value",br()))
in the R console, you'll see that the break tag br() is escaped as <br/>
. Thus, the solution is to specify that it is html.
infoBox("test_id",HTML(paste("test_value",br())))
Upvotes: 13