-
Notifications
You must be signed in to change notification settings - Fork 4
/
README.Rmd
97 lines (66 loc) · 2.8 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# summaryBox
<!-- badges: start -->
<!-- badges: end -->
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)
```