Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R shiny sizing boxes

My problem is that I told shiny to take all the line (12 columns) to print c7 box but it only uses half of it. Can anyone figure out what is the problem? Following is my code:

 library(shinydashboard)
 library(shiny)
 library(readr)
 library(rsconnect)
 header=dashboardHeader(title="App")
 sidebar=dashboardSidebar(sidebarMenu(
 menuItem("Stack", tabName = "a", icon = icon("dashboard"))))
 c7=column(12,box(title="Prediction Box",status="warning",solidHeader=FALSE,
            textInput("text", label = h3("Write something :"), value = ""),actionButton("do","Go")))
 body=dashboardBody(tabItems(tabItem(tabName="a",fluidRow(c7))))
 ui <- dashboardPage(header,sidebar,body)

 server <- function(input, output){
 }
shinyApp(ui,server) 
like image 431
FFL75 Avatar asked Jun 14 '26 22:06

FFL75


1 Answers

By default, if you're not specifying the width of the box it will be set to 6. Have a look at ?box

E.g.: enter image description here

library(shinydashboard)
library(shiny)

header=dashboardHeader(title="App")
sidebar=dashboardSidebar(sidebarMenu(menuItem("Stack", tabName = "a", icon = icon("dashboard"))))

?box
c7=column(12,box(width=12,title="Prediction Box",status="warning",solidHeader=FALSE,
                 textInput("text", label = h3("Write something :"), value = ""),actionButton("do","Go")))


body=dashboardBody(tabItems(tabItem(tabName="a",fluidRow(c7))))
ui <- dashboardPage(header,sidebar,body)

server <- function(input, output){
}
shinyApp(ui,server) 

enter image description here

like image 145
Pork Chop Avatar answered Jun 17 '26 11:06

Pork Chop