Build a UIkit Card for Shiny

Build a UIkit Card Body for Shiny

Build a UIkit Card media for Shiny

Build a UIkit Card title for Shiny

Build a UIkit Card Header

Build a UIkit Card Footer

ukCard(..., style = NULL, size = NULL, width = NULL, hover = FALSE,
  margin = NULL, padding = NULL, sortable = FALSE)

ukCardBody(..., style = NULL, size = NULL, hover = FALSE, width = NULL,
  height = NULL, margin = NULL, padding = NULL, sortable = FALSE)

ukCardMedia(..., position = "top")

ukCardTitle(title, margin_position = NULL, margin_size = NULL)

ukCardHeader(..., width = NULL)

ukCardFooter(...)

Arguments

...

The UI elements to place in the card

style

character. Can be 'default', 'primary' or 'secondary'.

size

character. Can be 'small' or 'large'.

width

character. Can be 'default', 'primary' or 'secondary'.

hover

logical. Create hover effect on the card.

sortable

logical. Allow the card to be sortable.

height

character. Can be 'default', 'primary' or 'secondary'.

position

character. 'top', 'bottom', 'left' or 'right'

title

character. The card title

...

The UI elements to place in the card body

style

character. Can be 'default', 'primary' or 'secondary'.

...

The UI elements to place in the card media

...

UI element inside the header

...

UI element inside the header

Examples

# NOT RUN {
library(shiny)
shinyApp(
 ui = ukPage(
   ukContainer(
     ukCard(
       ukCardHeader(ukCardTitle("A nice graph")),
       ukCardBody(plotOutput("graph")),
       ukCardFooter(ukButton(tags$p("More..."), style = "text", href = "#")),
       style = "default")
  )
 ),
 server = function(input, output) {
   output$graph <- renderPlot(hist(rnorm(1000)))
 })


card_line <- function(label)
  tags$li(tags$div(class = "uk-card uk-card-default uk-card-body uk-sortable-handle", label))
ui <- ukPage(
  tags$ul(class = "uk-grid-small uk-child-width-1-3 uk-text-center", `uk-sortable` = "handle: .uk-sortable-handle", `uk-grid` = NA,
        card_line("Item1"),
        card_line("Item2"),
        card_line("Item3"))
)
server <- function(input, output) {}
shinyApp(ui, server)

# }