Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter to add css classes to a bs4Card() #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion R/cards.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' TRUE by default
#' @param gradientColor If NULL (the default), the background of the box will be
#' white. Otherwise, a color string. "primary", "success", "warning" or "danger".
#' @param class A character string that will be added to the card's list of css classes.
#' @param width The width of the box, using the Bootstrap grid system. This is
#' used for row-based layouts. The overall width of a region is 12, so the
#' default width of 4 occupies 1/3 of that width. For column-based
Expand Down Expand Up @@ -129,7 +130,7 @@
#' @export
bs4Card <- function(..., inputId = NULL, title = NULL, footer = NULL, status = NULL, elevation = NULL,
solidHeader = FALSE, headerBorder = TRUE, gradientColor = NULL,
width = 6, height = NULL, collapsible = TRUE, collapsed = FALSE,
class = NULL, width = 6, height = NULL, collapsible = TRUE, collapsed = FALSE,
closable = TRUE, maximizable = FALSE, labelStatus = NULL, labelText = NULL,
labelTooltip = NULL, dropdownMenu = NULL, dropdownIcon = "wrench",
overflow = FALSE, enable_sidebar = FALSE, sidebar_content = NULL,
Expand Down Expand Up @@ -157,6 +158,10 @@ bs4Card <- function(..., inputId = NULL, title = NULL, footer = NULL, status = N
}
}

if (!is.null(class))
cardCl <- paste(cardCl, class)


if (enable_sidebar) {
if (sidebar_start_open) {
cardCl <- paste0(cardCl, " direct-chat direct-chat-contacts-open")
Expand Down
10 changes: 6 additions & 4 deletions man/bs4Card.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.