Debian Codegraph @

man/fillRow.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/bootstrap-layout.R
3 \name{fillRow}
4 \alias{fillRow}
5 \alias{fillCol}
6 \title{Flex Box-based row/column layouts}
7 \usage{
8 fillRow(..., flex = 1, width = "100\%", height = "100\%")
9
10 fillCol(..., flex = 1, width = "100\%", height = "100\%")
11 }
12 \arguments{
13 \item{...}{UI objects to put in each row/column cell; each argument will
14 occupy a single cell. (To put multiple items in a single cell, you can use
15 \code{\link[=tagList]{tagList()}} or \code{\link[=div]{div()}} to combine them.) Named
16 arguments will be used as attributes on the \code{div} element that
17 encapsulates the row/column.}
18
19 \item{flex}{Determines how space should be distributed to the cells. Can be a
20 single value like \code{1} or \code{2} to evenly distribute the available
21 space; or use a vector of numbers to specify the proportions. For example,
22 \code{flex = c(2, 3)} would cause the space to be split 40\%/60\% between
23 two cells. NA values will cause the corresponding cell to be sized
24 according to its contents (without growing or shrinking).}
25
26 \item{width, height}{The total amount of width and height to use for the
27 entire row/column. For the default height of \code{"100\%"} to be
28 effective, the parent must be \code{fillPage}, another
29 \code{fillRow}/\code{fillCol}, or some other HTML element whose height is
30 not determined by the height of its contents.}
31 }
32 \description{
33 Creates row and column layouts with proportionally-sized cells, using the
34 Flex Box layout model of CSS3. These can be nested to create arbitrary
35 proportional-grid layouts. \strong{Warning:} Flex Box is not well supported
36 by Internet Explorer, so these functions should only be used where modern
37 browsers can be assumed.
38 }
39 \details{
40 If you try to use \code{fillRow} and \code{fillCol} inside of other
41 Shiny containers, such as \code{\link[=sidebarLayout]{sidebarLayout()}},
42 \code{\link[=navbarPage]{navbarPage()}}, or even \code{tags$div}, you will probably find
43 that they will not appear. This is due to \code{fillRow} and \code{fillCol}
44 defaulting to \code{height="100\%"}, which will only work inside of
45 containers that have determined their own size (rather than shrinking to
46 the size of their contents, as is usually the case in HTML).
47
48 To avoid this problem, you have two options:
49 \itemize{
50 \item only use \code{fillRow}/\code{fillCol} inside of \code{fillPage},
51 \code{fillRow}, or \code{fillCol}
52 \item provide an explicit \code{height} argument to
53 \code{fillRow}/\code{fillCol}
54 }
55 }
56 \examples{
57 # Only run this example in interactive R sessions.
58 if (interactive()) {
59
60 ui <- fillPage(fillRow(
61 plotOutput("plotLeft", height = "100\%"),
62 fillCol(
63 plotOutput("plotTopRight", height = "100\%"),
64 plotOutput("plotBottomRight", height = "100\%")
65 )
66 ))
67
68 server <- function(input, output, session) {
69 output$plotLeft <- renderPlot(plot(cars))
70 output$plotTopRight <- renderPlot(plot(pressure))
71 output$plotBottomRight <- renderPlot(plot(AirPassengers))
72 }
73
74 shinyApp(ui, server)
75
76 }
77 }