Reputation: 2653
I want to show some summary report in my modal window and it has multiple lines. How can I change the font of the text?
shinyApp(
ui = basicPage(
actionButton("show", "Show modal dialog")
),
server = function(input, output) {
observeEvent(input$show, {
str1 = paste('iris data frame has ', nrow(iris), 'rows')
str2 = paste('cars data frame has ', nrow(cars), 'rows')
showModal(modalDialog(
title = "Important message",
renderUI(HTML(paste(str1, str2, sep = '<br/>')))
))
})
}
)
Upvotes: 0
Views: 363
Reputation: 84659
A possibility:
library(shiny)
shinyApp(
ui = basicPage(
actionButton("show", "Show modal dialog")
),
server = function(input, output) {
observeEvent(input$show, {
str1 = tags$span(
paste('iris data frame has ', nrow(iris), 'rows'),
style = "font-size: 25px;"
)
str2 = tags$span(
paste('cars data frame has ', nrow(cars), 'rows'),
style = "font-size: 25px"
)
showModal(modalDialog(
title = "Important message",
tagList(str1, br(), str2)
))
})
}
)
Upvotes: 2