Description Usage Arguments Examples
Use this function inside the UI of a Shiny application to define a Shuffle layout.
1 2 3 4 5 6 7 8 9 | shuffle_container(
shuffleId,
...,
card_list = NULL,
options = shuffle_options(),
no_card = NULL,
use_bs_grid = FALSE,
width = NULL
)
|
shuffleId |
Shuffle's id. |
... |
List of |
card_list |
Alternative list of |
options |
Options for Shuffle, see |
no_card |
UI definition (or text) to display when all cards are filtered out. |
use_bs_grid |
Allow to use Bootstrap grid system, e.g. same
as in |
width |
The width of the container, e.g. |
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 | if (interactive()) {
library(shiny)
library(shufflecards)
ui <- fluidPage(
tags$h2("Create a responsive grid of cards"),
shuffle_container(
shuffleId = "grid",
width = "650px",
shuffle_card(
tags$div("My first card", style = "text-align: center; line-height: 200px"),
style = "border: 2px solid red; border-radius: 5px;",
width = "300px", # better with fixed width/height
height = "200px"
),
shuffle_card(
tags$div("Second one", style = "text-align: center; line-height: 200px"),
style = "border: 2px solid red; border-radius: 5px;",
width = "300px", # better with fixed width/height
height = "200px"
),
shuffle_card(
tags$div("Third one", style = "text-align: center; line-height: 200px"),
style = "border: 2px solid red; border-radius: 5px;",
width = "300px", # better with fixed width/height
height = "200px"
),
shuffle_card(
tags$div("Fourth one", style = "text-align: center; line-height: 200px"),
style = "border: 2px solid red; border-radius: 5px;",
width = "300px", # better with fixed width/height
height = "200px"
)
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.