Grid sytem for shiny apps or rmarkdown document, mainly to create htmlwidgets matrix. R interface for grillade from KNACSS.
You can install the development version of grillade from GitHub with:
remotes::install_github("dreamRs/grillade")
The main function grillade()
can be used in three different ways :
The default behavior is to create as many columns as elements of the grillade()
:
library(grillade) # For example, use a div with borders box_example <- function(...) { tags$div( style = "box-sizing:border-box;border:5px solid #1C6EA4;height:100%;", ... ) } # Construct the grid grillade( box_example("Column 1"), box_example("Column 2"), box_example("Column 3"), box_example("Column 4"), box_example("Column 5") )
You can customize the grid by providing number of columns, and specifying widths and heights of elements with knack()
:
grillade( n_col = 3, knack( cols = 2, box_example("Column 1") ), box_example("Column 2"), box_example("Column 3"), knack( cols = 2, rows = 2, box_example("Column 4") ), box_example("Column 5") )