diff --git a/NEWS.md b/NEWS.md index 4176e25..5c69a4f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,5 @@ # argonR 0.2.0.9000 +- add offset arg to `argonColumn()` - Add btn_text argument to `argonCard()` - Fix #1: headroom.js and add the corresponding argument to `argonNavbar()` - Fix #7 introduced with #4 diff --git a/R/argonColumn.R b/R/argonColumn.R index c13c6c8..9c070af 100644 --- a/R/argonColumn.R +++ b/R/argonColumn.R @@ -5,6 +5,7 @@ #' @param ... Any UI element. #' @param width Optional. Column width between 1 and 12. #' @param center Whether to center column elements or not. FALSE by default. +#' @param offset Column offset. NULL by default. Importantly, offset + width cannot exceed 12! #' #' @examples #' if (interactive()) { @@ -24,10 +25,10 @@ #' @author David Granjon, \email{dgranjon@@ymail.com} #' #' @export -argonColumn <- function(..., width = NULL, center = FALSE) { - - colCl <- if(!is.null(width)) paste0("col-sm-", width) else "col-sm" +argonColumn <- function (..., width = NULL, center = FALSE, offset = NULL) { + colCl <- "col-sm" + if (!is.null(width)) colCl <- paste0(colCl, " col-sm-", width) + if (!is.null(offset)) colCl <- paste0(colCl, " offset-sm-", offset) if (center) colCl <- paste0(colCl, " text-center") - htmltools::tags$div(class = colCl, ...) } \ No newline at end of file diff --git a/docs/articles/getting_started.html b/docs/articles/getting_started.html index 14d54e0..5d82d00 100644 --- a/docs/articles/getting_started.html +++ b/docs/articles/getting_started.html @@ -96,7 +96,7 @@
vignettes/getting_started.Rmd
getting_started.Rmd
argonColumn()
+argonCard()
argonNavbar()
diff --git a/docs/reference/argonColumn.html b/docs/reference/argonColumn.html
index 23a8040..0cf324d 100644
--- a/docs/reference/argonColumn.html
+++ b/docs/reference/argonColumn.html
@@ -138,7 +138,7 @@ argonColumn(..., width = NULL, center = FALSE)+
argonColumn(..., width = NULL, center = FALSE, offset = NULL)
center | Whether to center column elements or not. FALSE by default. |
+
---|---|
offset | +Column offset. NULL by default. Importantly, offset + width cannot exceed 12! |
+