centred_row | R Documentation |
shiny::fluidRow()
and shiny::column()
.Create a Shiny fluidRow with centred content
This is a convenience function intended for use in Shiny apps where you
want content centred, surrounded to left and white by whitespace, using
shiny::fluidRow()
and shiny::column()
.
centred_row(
content,
left_content = NULL,
right_content = NULL,
left_space = 2,
right_space = left_space,
max_width_px = 1140,
...
)
content |
The content you wish to place in the main (middle) column
of the row, such as |
left_content |
The content to be placed in the left hand column. |
right_content |
The content to be placed in the right hand column. |
left_space |
Numeric. Default is |
right_space |
Numeric. Default is equal to |
max_width_px |
Maximum width of content, in pixels. |
... |
Additional elements passed to main column. Can be used for
attributes such as |
This function creates a shiny::fluidRow()
then divides that
row into three columns. The left and right columns are whitespace. The
content goes in the centre column. Any space not allocated to the left or
right space is left for the content.
Units of measurement for left_space
and right_space
are based on the
Bootstrap 12-wide grid system. A value of 2 therefore means that a column
will take up 1/6th of the horizontal space on the page.
The total width of each column must be at least 1. The total width of the three columns must be equal to 12. Each column therefore cannot be greater than 10 width.
a shiny.tag
object that creates a three-column fluidRow.
centred_row(shiny::plotOutput("plot1"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.