cecilialee
2/24/2018 - 3:17 AM

Render string in multiple lines using HTML in Shiny

Render string in multiple lines using HTML in Shiny. #r #shiny

library(shiny)

ui = basicPage(
  textInput("txt1", "Input the first string"),
  textInput("txt2", "Input the second string"),
  
  uiOutput("cat_str")
)

server = function(input, output) {
  output$cat_str <- renderUI({
    HTML(paste(input$txt1, input$txt2, sep = "<br/>"))
  })
}

shinyApp(ui, server)