Shinydashboard Tabbox Height

Dynamic height adjustment of tabpanel does not work with infobox

Very easy, wrap the infoBoxOutput inside a fluidRow:

library("shiny")
library("shinydashboard")
library("shinydashboardPlus")

ui <- dashboardPage(
header = dashboardHeader()
,sidebar = dashboardSidebar()
,body = dashboardBody(

tabBox(
tabPanel(
title = "Tab1",
fluidRow(
infoBoxOutput(outputId = "ibo")
)
)
,tabPanel(
title = "Tab2"
,plotOutput(outputId = "po")
)
,width = 12
)

)
)

server <- function(input, output) {

output$ibo <- renderInfoBox({
infoBox(
title = "Infobox"
,value = 42
)
})

output$po <- renderPlot({
plot(mtcars$mpg, mtcars$cyl)
})

}

shinyApp(ui = ui, server = server)

Sample Image

Adjust plot and box height in a shiny dashboard regardless the Operational System and the Screen Resolution

Maybe you want

tabPanel("Plot",
boxPlus(
plotlyOutput("plot1", height = "80vh"),
height = "80vh"
)
)

80vh means 80% of the height of the viewport.

Resize height of DataTable inside a Box in ShinyDashboard

Try withSpinner(DT::dataTableOutput("tab", height = '240px'), currently your code is setting the height of the box, not the data table.

Also, try style = "overflow-x: scroll;" in the box() arguments for the scrolling

Shinydashboard: Incorrect vertical rendering of items in tabbox

If you specify your height in the ui like this plotOutput("plot", height = "600px") it should render correctly

shinyDashboard; Maximizing tabBox with a sidebar will add a horizontal Scrollbar to the box?

I tried refining the css a bit


# Toggle a box sidebar
library(shiny)
library(bs4Dash)

shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
body = dashboardBody(
tags$style(".card.maximized-card .card-body {overflow-x: hidden !important; }"),
box(
height = "500px",
width = 12,
maximizable = T,
solidHeader = FALSE,
collapsible = TRUE,
sidebar = boxSidebar(
id = "mycardsidebar",
width = 30,
p("Sidebar Content")
)
)
),
sidebar = dashboardSidebar()
),
server = function(input, output, session) {}
)


Related Topics



Leave a reply



Submit