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)
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
Gray Out a Section of an Image with CSS
Scss Function for Animation Keyframes
How to Test CSS Properties for a React Component Using React-Testing-Library
HTML5 Table Cell Padding - Different in Browsers
How to Style Radio Buttons with Different Colors
Why Do I Need "Height: Auto" for Responsive Images
Ie7 and "Inherit": Ignoring Entire Rule
Fieldset Contents Overflow in Firefox
Internal Stylesheet Not Working in Ie9 with Jsf
Why Does Overflow: Hidden Add Additional Height to an Inline-Block Element
Background Image in Styled Components React
Probleme CSS3 Scale Transform and Overflow:Hidden on Safari
React Native Flatlist Separator Between Columns