With shinydashboardPlus, you can add labels and dropdown menus to your boxes. You just have to use boxPlus()
instead of box()
from shinydashboard.
There are also other boxes such as gradientBox()
, socialBox()
as well as widgetUserBox()
, to help you making outstanding shiny apps.
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
shinyApp(
ui = dashboardPagePlus(
dashboardHeaderPlus(),
dashboardSidebar(),
dashboardBody(
fluidRow(
boxPlus(
title = "Closable Box",
closable = TRUE,
status = "warning",
solidHeader = FALSE,
collapsible = TRUE,
p("Box Content")
),
boxPlus(
title = "Closable box, with label",
closable = TRUE,
enable_label = TRUE,
label_text = 1,
label_status = "danger",
status = "warning",
solidHeader = FALSE,
collapsible = TRUE,
p("Box Content")
)
)
)
),
server = function(input, output) {}
)
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
shinyApp(
ui = dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
gradientBox(
title = "My gradient Box",
icon = "fa fa-th",
gradientColor = "teal",
boxToolSize = "sm",
footer = sliderInput(
"obs",
"Number of observations:",
min = 0, max = 1000, value = 500
),
"This is a gradient box"
),
gradientBox(
title = "My gradient Box",
icon = "fa fa-heart",
gradientColor = "maroon",
boxToolSize = "xs",
closable = TRUE,
footer = "The footer goes here. You can include anything",
"This is a gradient box"
)
),
title = "Description Blocks"
),
server = function(input, output) { }
)
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
shinyApp(
ui = dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
widgetUserBox(
title = "Nadia Carmichael",
subtitle = "lead Developer",
type = 2,
src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg",
color = "yellow",
"Some text here!",
footer = "The footer here!"
),
widgetUserBox(
title = "Alexander Pierce",
subtitle = "Founder & CEO",
type = NULL,
src = "https://adminlte.io/themes/AdminLTE/dist/img/user1-128x128.jpg",
color = "aqua-active",
closable = TRUE,
"Some text here!",
footer = "The footer here!"
),
widgetUserBox(
title = "Elizabeth Pierce",
subtitle = "Web Designer",
type = NULL,
src = "https://adminlte.io/themes/AdminLTE/dist/img/user3-128x128.jpg",
background = TRUE,
backgroundUrl = "https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg?auto=compress&cs=tinysrgb&h=350",
closable = TRUE,
"Some text here!",
footer = "The footer here!"
)
),
title = "Description Blocks"
),
server = function(input, output) { }
)
socialBox