Allows you to place any item directly on the grid without having to wrap it in grid_card() or other containers. This is done by adding a css property and data-attribute to the tag object.

grid_place(area, element)

Arguments

area

Area of grid corresponding to the wrapping grid containers grid definition

element

Element (html tag) to be placed.

Value

The element updated with a gridlayout-area data-attribute and the grid-area property added to its styles

See also

grid_card() to place content on the grid wrapped in a bootstrap card.

Examples

if (FALSE) {
  library(gridlayout)
  library(shiny)
  library(bslib)

  shinyApp(
    ui = grid_page(
      layout = c("A B B"),
      grid_place(
        "A",
        sliderInput("bins","Number of bins:", min = 1, max = 50, value = 30, width = "100%")
      ),
      grid_place(
        "B",
        plotOutput("distPlot", height = "100%")
      )
    ),
    server = function(input, output, session) {
      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')
      })
    }
  )

}