R/Shiny/bs4Dash에서 ValueBox

6100 단어 RShinybs4DashAdminLTE
이런 느낌.
library(shiny)
library(bs4Dash)

ui <- bs4DashPage(
  navbar = bs4DashNavbar(),
  sidebar = bs4DashSidebar(),
  body = bs4DashBody(
    fluidRow(
      bs4ValueBox(
        value = iris$Sepal.Length[nrow(iris)],
        subtitle = "Sepal.Length",
        icon = "pie-chart",
        status = "primary",
        width = 8
      ),
      bs4ValueBoxOutput(
        outputId = "vb",
        width = 4
      )
    )
  ),
  controlbar = bs4DashControlbar(),
  footer = bs4DashFooter(),
  title = "yono2844"
)

server <- function(input, output, session) {
  output$vb <- renderbs4ValueBox(expr = {
    bs4ValueBox(
      value = iris$Sepal.Width[nrow(iris)],
      subtitle = "Sepal.Width",
      icon = "car",
      status = "info"
    )
  })
}

shinyApp(ui = ui, server = server)

좋은 웹페이지 즐겨찾기