R/Shiny/bs4Dash의 기초③

10827 단어 RShinybs4DashAdminLTE

사이드바 구현



이런 느낌으로 실장할 수 있다(잡). icon은 여기 에서 참조한다.
library(shiny)
library(bs4Dash)

ui <- bs4DashPage(
  navbar = bs4DashNavbar(),
  sidebar = bs4DashSidebar(
    bs4SidebarMenu(
      bs4SidebarHeader(title = "x"),
      bs4SidebarMenuItem(text = "x1", tabName = "x1", icon = "bar-chart"),
      bs4SidebarMenuItem(text = "x2", tabName = "x2", icon = "thermometer-quarter"),
      bs4SidebarMenuItem(text = "x3", tabName = "x3", icon = "snowflake-o"),
      bs4SidebarHeader(title = "y"),
      bs4SidebarMenuItem(text = "y1", tabName = "y1", icon = "ravelry"),
      bs4SidebarMenuItem(text = "y2", tabName = "y2", icon = "user-circle-o "),
      bs4SidebarMenuItem(text = "y3", tabName = "y3", icon = "car"),
      bs4SidebarHeader(title = "z"),
      bs4SidebarMenuItem(
        text = "z1",
        bs4SidebarMenuSubItem(text = "z11", tabName = "z11", icon = "area-chart"),
        bs4SidebarMenuSubItem(text = "z12", tabName = "z12", icon = "battery-full"),
        bs4SidebarMenuSubItem(text = "z13", tabName = "z13", icon = "bell-slash"),
        icon ="bolt"
      )
    ),
    title = "yono2844",
    skin = "light",
    url = "https://qiita.com/yono2844",
    src = "https://secure.gravatar.com/avatar/4f1b709d53f6d347a9b93e922b883ff3"
  ),
  body = bs4DashBody(),
  controlbar = bs4DashControlbar(),
  footer = bs4DashFooter(),
  title = "bs4Dash"
)

server <- function(input, output, session) {
}

shinyApp(ui = ui, server = server)

좋은 웹페이지 즐겨찾기