https://github.com/deepanshu88/summaryBox
Value and Info Boxes in Shiny Apps and Rmarkdown (Bootstrap 4)
https://github.com/deepanshu88/summaryBox
r rmarkdown rstats shiny
Last synced: 3 months ago
JSON representation
Value and Info Boxes in Shiny Apps and Rmarkdown (Bootstrap 4)
- Host: GitHub
- URL: https://github.com/deepanshu88/summaryBox
- Owner: deepanshu88
- Created: 2021-03-25T05:02:50.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-23T12:52:58.000Z (over 2 years ago)
- Last Synced: 2024-08-13T07:03:11.319Z (6 months ago)
- Topics: r, rmarkdown, rstats, shiny
- Language: HTML
- Homepage: https://www.listendata.com/2021/03/value-info-box-in-shiny-rmarkdown.html
- Size: 2.23 MB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
- jimsghstars - deepanshu88/summaryBox - Value and Info Boxes in Shiny Apps and Rmarkdown (Bootstrap 4) (HTML)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# summaryBox
The objective of this package is to add value / info boxes in shiny and Rmarkdown (bootstrap 4). Value and Info Boxes are very popular to display insights in colorful boxes, they are available in `shinydashboard` package but not in shiny and Rmarkdown.
## Installation
You can install the released version of summaryBox from Github with:
``` r
# install.packages("remotes")
remotes::install_github("deepanshu88/summaryBox")
```## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(shiny)
library(summaryBox)# Bootstrap 4
theme <- bslib::bs_theme(version = 4)# UI
ui <- fluidPage(theme = theme,
br(),
fluidRow(
summaryBox("Earnings (Monthly)", "$40,000", width = 3, icon = "fas fa-calendar", style = "info"),
summaryBox("Earnings (Annual)", "9332", width = 3, icon = "fas fa-dollar-sign", style = "success"),
summaryBox("Tasks", "346", width = 3, icon = "fas fa-clipboard-list", style = "danger"),
summaryBox("Pending Requests", "346", width = 3, icon = "fas fa-comments", style = "primary")),
fluidRow(
summaryBox("Earnings (Monthly)", "$40,000", width = 3, icon = "fas fa-calendar", style = "info", border = "bottom"),
summaryBox("Earnings (Annual)", "9332", width = 3, icon = "fas fa-dollar-sign", style = "success", border = "bottom"),
summaryBox("Tasks", "346", width = 3, icon = "fas fa-clipboard-list", style = "danger", border = "bottom"),
summaryBox("Pending Requests", "346", width = 3, icon = "fas fa-comments", style = "primary", border = "bottom")),
fluidRow(
summaryBox2("Earnings (Monthly)", "$40,000", width = 3, icon = "fas fa-calendar", style = "info"),
summaryBox2("Earnings (Annual)", "9332", width = 3, icon = "fas fa-dollar-sign", style = "success"),
summaryBox2("Tasks", "346", width = 3, icon = "fas fa-clipboard-list", style = "danger"),
summaryBox2("Pending Requests", "346", width = 3, icon = "fas fa-comments", style = "primary")
),br(),
# Info Box
fluidRow(
summaryBox3("Earnings (Monthly)", "$40,000", width = 3, icon = "fas fa-calendar", style = "info"),
summaryBox3("Earnings (Annual)", "9332", width = 3, icon = "fas fa-dollar-sign", style = "success"),
summaryBox3("Tasks", "346", width = 3, icon = "fas fa-clipboard-list", style = "danger"),
summaryBox3("Pending Requests", "346", width = 3, icon = "fas fa-comments", style = "primary")
))
# Server
server <- function(input, output, session) {}
# Run App
shinyApp(ui = ui, server = server)```