I would like to change the font size of the value and the subtitle for valueBox
es.
Below is my attempt, but would be grateful of any suggestions on how to c
Hi you can change font size directly in valueBox
with a p
tag without rewriting valueBox
function (if you want you can, just wrap value
and subtitle
args in tags$p
), try :
library("shiny")
library("shinydashboard")
# header
header <- dashboardHeader(title = "Changing the font size of valueBoxes", titleWidth = 450)
# sidebar
sidebar <- dashboardSidebar(disable = TRUE)
# body
body <- dashboardBody(
valueBox(
value = "90k",
subtitle = "some long descritptive text",
icon = icon("car")
),
valueBox(
value = tags$p("90k", style = "font-size: 150%;"),
subtitle = tags$p("some long descritptive text", style = "font-size: 150%;"),
icon = icon("car fa-lg")
),
valueBox(
value = tags$p("90k", style = "font-size: 200%;"),
subtitle = tags$p("some long descritptive text", style = "font-size: 200%;"),
icon = icon("car fa-2x")
),
valueBoxOutput(outputId = "mybigbox")
)
# server
server <- function(input, output) {
output$mybigbox <- renderValueBox({
valueBox(
value = tags$p("90k", style = "font-size: 300%;"),
subtitle = tags$p("some long descritptive text", style = "font-size: 300%;"),
icon = icon("car fa-3x")
)
})
}
shinyApp(ui = dashboardPage(header, sidebar, body), server = server)