-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
335 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
#' Create a theme for bs4Dash | ||
#' | ||
#' @inheritParams bslib::bs_theme | ||
#' @param ... Additional AdminLTE variables. | ||
#' | ||
#' @return Returns a [sass::sass_bundle()] (list-like) object. | ||
#' @export | ||
#' | ||
#' @importFrom bslib bs_theme bs_add_variables bs_add_rules bs_theme_dependencies | ||
#' | ||
#' @example examples/bs4Dash_theme-ex.R | ||
bs4Dash_theme <- function(primary = NULL, | ||
secondary = NULL, | ||
success = NULL, | ||
info = NULL, | ||
warning = NULL, | ||
danger = NULL, | ||
...) { | ||
theme <- bs_theme( | ||
version = 4, | ||
preset = "bootstrap", | ||
primary = primary, | ||
secondary = secondary, | ||
success = success, | ||
info = info, | ||
warning = warning, | ||
danger = danger | ||
) | ||
theme <- bs_add_variables( | ||
theme = theme, | ||
... | ||
) | ||
theme <- bs_add_rules( | ||
theme = theme, | ||
adminlte3_scss() | ||
) | ||
class(theme) <- c(class(theme), "bs4Dash_theme") | ||
return(theme) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
|
||
library(shiny) | ||
library(bs4Dash) | ||
library(fresh) | ||
|
||
ui <- dashboardPage( | ||
options = NULL, | ||
header = dashboardHeader( | ||
status = "primary", | ||
title = dashboardBrand( | ||
title = "My dashboard", | ||
color = "primary", | ||
href = "https://adminlte.io/themes/v3", | ||
image = "https://adminlte.io/themes/v3/dist/img/AdminLTELogo.png" | ||
) | ||
), | ||
sidebar = dashboardSidebar( | ||
sidebarMenu( | ||
menuItem( | ||
text = "Tab 1", | ||
tabName = "tab1", | ||
icon = icon("van-shuttle") | ||
), | ||
menuItem( | ||
text = "Tab 2", | ||
tabName = "tab2", | ||
icon = icon("shuttle-space") | ||
) | ||
) | ||
), | ||
body = dashboardBody( | ||
use_theme( | ||
bs4Dash_theme( | ||
primary = "purple", | ||
success = "yellow", | ||
danger = "pink", | ||
"sidebar-light-bg" = "#C38AFF", | ||
"main-bg" = "#D9BBFF" | ||
) | ||
), | ||
box(status = "danger", solidHeader = TRUE, title = "Title", "Content"), | ||
box(status = "primary", solidHeader = TRUE, title = "Title", "Content"), | ||
box(status = "success", solidHeader = TRUE, title = "Title", "Content") | ||
), | ||
controlbar = dashboardControlbar(), | ||
title = "DashboardPage" | ||
) | ||
|
||
|
||
if (interactive()) { | ||
shinyApp( | ||
ui = ui, | ||
server = function(...) {} | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.