Description Usage Arguments See Also Examples
These functions are the foundation of any application. Grid elements are
nested as follows: container() > columns() > column() ~ column()
. A
column()
may be created with an explicit width, 1 through 12. To fit a
column automatically to its content use width = "content"
. To divide the
space in a row evenly amongst all columns use width = "equal"
. For examples
and usage tips see the sections below.
1 2 3 4 5 |
... |
Any number of tags elements passed as child elements or named arguments passed as HTML attributes to the parent element. |
width |
A responsive argument. One of |
centered |
One of |
Other layout functions:
fieldset()
,
flex()
,
navbar()
,
responsive
,
webpage()
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | ### Equal width columns
container(
columns(
column(
"Aliquam erat volutpat."
),
column(
"Mauris mollis tincidunt felis."
),
column(
"Cum sociis natoque penatibus et magnis dis parturient montes,",
"nascetur ridiculus mus."
)
)
)
### Shiny's panel with sidebar layout
container(
columns(
column(
width = 4,
card(
title = "Sidebar",
formGroup(
label = "Control 1",
selectInput("control1", "...")
),
formGroup(
label = "Control 2",
selectInput("control2", "...")
),
formGroup(
label = "Control 3",
selectInput("control3", "...")
)
)
),
column(
d4("Main panel")
)
)
)
### Mobile friendly grids
# Use `column()`s [responsive] `width` argument to make mobile friendly
# applications.
container(
columns(
column(
width = c(sm = 4),
"Mauris ac felis vel velit tristique imperdiet."
),
column(
width = c(sm = 4),
"Nam vestibulum accumsan nisl."
),
column(
width = c(sm = 4),
"Proin neque massa, cursus ut, gravida ut, lobortis eget, lacus."
)
)
)
# or
container(
columns(
column(
width = c(sm = 4),
"Aenean in sem ac leo mollis blandit."
),
column(
width = c(sm = 8),
"Nulla posuere. In id erat non orci commodo lobortis."
)
)
)
### Fit columns to their content
container(
columns(
column(),
column(
width = "content",
"Cras placerat accumsan nulla. Aenean in sem ac leo mollis blandit."
),
column()
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.