Best way to change bslib value_box title text size?

175 Views Asked by At

I'm putting a few a bslib value_box on my shiny page and have it working well but the font size for the title is smaller than I would like and can be hard to read. I have read through the bslib and value_box documentation and there doesn't seem to be a way to change title font size. Is there a way to increase the font size for the value_box title?

library(bsicons)
library(bslib)

ui <- page_fixed(
  value_box(
    title = "24-hour snowfall",
    value = textOutput("snow"),
    showcase = bs_icon("snow2"), 
    theme_color = "green"
  )
)

server <- function(input, output) {
  output$snow <- renderText({
  "2 inches"
  })
}

shinyApp(ui, server)
1

There are 1 best solutions below

0
On

I was able to find the correct sections of CSS code to modify. The following code was able to change the title of the value boxes and solved my issue.

tags$head(tags$style(HTML('.bslib-value-box .value-box-title {font-size:18px;}'))),