Reputation: 727
I'm building an app with a lot of box
es using shinydashboard. Ideally I'd like to have three boxes in one fluidRow
. If I just plop them in, they widen so much that the third gets bumped down, but if I put them each in their own column(width = 4, ...)
, then each of them only takes up about half its column, leaving unsightly gaps between them.
Is there a way to force a box to take up its whole column?
Upvotes: 1
Views: 1689
Reputation: 5687
By default, the box
function has a width = 6
, you can change it to 12 to cover all the column. However, according to the shinydashboard documentation, you should set width = NULL
for column-based layouts. See the example below.
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
fluidRow(
column(4, box(title = "box1", width = NULL)),
column(4, box(title = "box2", width = NULL)),
column(4, box(title = "box3", width = NULL))
)
)
)
server <- function(input, output) {
}
shinyApp(ui, server)
Upvotes: 3