R shinydashboard - 改变值框的高度

R shinydashboard - change height of valueBox

给定一个 shinydashboard

ui.R

library(shinydashboard)
library(shiny)

dashboardPage(

    dashboardHeader(),
    dashboardSidebar(),
    dashboardBody(
        valueBoxOutput(outputId = "vb")
    )
)

server.R

library(shinydashboard)
library(shiny)

function(input, output, session) {

    output$vb <- renderValueBox({
        valueBox(subtitle = "Hello", 
                         value = "hi", 
                         width = 6,
                         color="blue"
        )
    })
}

问题

是否可以更改 valueBox 的高度?

我试过使用 tags 但无法使它们正常工作,所以我显然遗漏了一些东西:

dashboardPage(

    dashboardHeader(),
    dashboardSidebar(
    #   tags$head(tags$style("#vb{height:500px}"))
    ),
    dashboardBody(
        # tags$head(tags$style("#vb{height:500px}")),

        # div(style="height: 500px",
        #       valueBoxOutput(outputId = "vb")
        # )
        valueBoxOutput(outputId = "vb")
    )
)

原来我没有正确引用值框;我需要使用 .small-box class:

dashboardPage(

    dashboardHeader(),
    dashboardSidebar(),
    dashboardBody(
        tags$head(tags$style(HTML(".small-box {height: 50px}"))),
        valueBoxOutput(outputId = "vb")
    )
)