Reputation: 480
Is there a way to parse HTML inside renderUI. I tried below code, but it is taking as character and not a HTML. Basically, "Next Line" should be displayed in the next line?
library(shiny)
ui <- fluidPage(
uiOutput("text")
)
server <- function(input, output, session) {
output$text <- renderUI({
paste0("Filtered value are for ", as.character(br()),"Next line")
})
}
shinyApp(ui, server)
Upvotes: 0
Views: 142
Reputation: 12585
I'm not sure why you're using renderUI
rather than renderText
...
library(shiny)
ui <- fluidPage(
uiOutput("text")
)
server <- function(input, output, session) {
output$text <- renderText({
paste0("Filtered value are for ", br(),"Next line")
})
}
shinyApp(ui, server)
Gives
If you do need to use renderUI
,
library(shiny)
ui <- fluidPage(
uiOutput("text")
)
server <- function(input, output, session) {
output$text <- renderUI({
tagList("Filtered value are for ", br(),"Next line")
})
}
shinyApp(ui, server)
gives the same result.
Upvotes: 1