R/Shiny/bs4Dashの基礎⑦


bodyにカードを追加

こんな感じ(雑)。カードの関数って色々と機能がありそう。

library(shiny)
library(bs4Dash)

ui <- bs4DashPage(
  navbar = bs4DashNavbar(),
  sidebar = bs4DashSidebar(
    bs4SidebarMenu(
      bs4SidebarHeader(title = "Iris"),
      bs4SidebarMenuItem(text = "X", tabName = "x")
    )
  ),
  body = bs4DashBody(
    bs4TabItems(
      bs4TabItem(
        tabName = "x",
        bs4Card(
          plotOutput(outputId = "a"),
          inputId = "a",
          title = "a",
          status = "primary"
        )
      )
    )
  ),
  controlbar = bs4DashControlbar(),
  footer = bs4DashFooter(),
  title = "yono2844"
)

server <- function(input, output, session) {
  output$a <- renderPlot(expr = {
    plot(iris$Sepal.Length, iris$Sepal.Width)
  })
}

shinyApp(ui = ui, server = server)