grid_card_old.Rd
grid_card_old(
area,
...,
title = NULL,
scrollable = FALSE,
collapsible = TRUE,
has_border = TRUE,
item_gap = "10px",
class = NULL
)
Name of grid area, should match an area defined in the layout
section of the wrapping grid_page()
or grid_container()
.
Arguments (typically children) passed to the htmltools::div()
that contain the card's contents
Character string to go across top of panel with label. If left blank the card contents will take up entire space.
Should scroll-bars be added so content that is larger than the panel can be seen?
Should the card be able to be collapsed (TRUE
or
FALSE
)? Gridlayout will only show collapser if the layout allows it
(panel is entirely positioned within "auto" sized rows, and has a title).
Setting this to FALSE
will mean collapsibility of the panel will never be
enabled, regardless of layout.
Should the card be surrounded by a border? Set to FALSE
to turn off.
How much vertical space should there be between children of card?
Additional CSS classes to include on the card div.
Note that this version of grid card has been replaced with a newer one based
on bslib::card()
. That is the recomended way of using cards in your layout.
This version is kept for compatibility with old apps while they are switched
to the new interface. The standard element for placing elements on the grid
in a simple card container
grid_card_text()
for a card with just text content,
grid_card_plot()
for a card with just plot content, grid_place()
to
place any tag onto the grid without needing to wrap in a card, and
card_plot_output()
for including a smart-sized plot within a card.
if (FALSE) {
library(gridlayout)
library(shiny)
library(bslib)
shinyApp(
ui = grid_page(
layout = c(
"header header",
"sidebar distPlot"
),
row_sizes = c("50px", "1fr"),
col_sizes = c("200px", "1fr"),
grid_card_text("header", "This is my header"),
grid_card_old(
"sidebar",
title = "Settings",
sliderInput("bins","Number of bins:", 1, 50, 30, width = "100%")
),
grid_card_plot("distPlot")
),
server = function(input, output) {
output$distPlot <- renderPlot({
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
}
)
}