(R shiny) cannot change the width of infoBox

Viewed 3971

I use the library shinydashboard to write my ui.R. In my dashboardBody part, I wrote:

fluidRow(infoBoxOutput("dri"))

And then in my server.R, I wrote:

output$dri = renderInfoBox({
    infoBox(
        width = 2,
        title = tags$b("Score"),
        value = tags$b("100"),
        color = "aqua",
        fill = TRUE,
        icon = icon("edit")
    )
})*

But the width won't change to 2; it still uses the default one, i.e. 4 (1/3 of the whole webpage width). Would someone help me with this? Thank you very much!

2 Answers

I found this answer on github and it worked for me aswell:

Instead of using renderInfoBox and infoBoxOutput, you can use renderUI and uiOutput and that worked for me. This makes me think there is an issue with the renderInfoBox function.

Related