Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding scroll to sidebar in flexdashboard

I am designing a UI using Flexdashboard and some of the textinput boxes are going beyond the regular browser window, I have added a line vertical_layout: scroll in my code but I am guessing that is not enough ? So my question is how do I enable vertical scrolling feature as shown in this image below. ? Any tips or pointers are much appreciated.

enter image description here

Here's my code below

---
title: "Untitled"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: scroll
    smooth_scroll: true
    runtime: shiny
---

```{r setup, include=FALSE}
library(flexdashboard)
```

     Inputs {.sidebar}
-----------------------------------------------------------------------

  ```{r}
library(shiny)
library(shinyjs)


shinyjs::useShinyjs()
#tags$hr(),
shinyjs::disabled(textInput("id", "Id", "0"))
textInput("X1", "X1", "")
textInput("X2", "X2", "")
textInput("X3", "X3", "")
textInput("X4", "X4", "")
textInput("X5", "X5", "")
textInput("X6", "X6", "")
textInput("X7", "X7", "")
textInput("X8", "X8", "")
textInput("X9", "X9", "")
textInput("X10", "X10", "")
textInput("X11", "X11", "")
textInput("X12", "X12", "")

textInput("X13", "X13", "")
textInput("X14", "X14", "")
textInput("X15", "X15", "")
textInput("X16", "X16", "")

checkboxInput("X17", "X17", FALSE)


#action buttons
actionButton("submit", "Submit Changes")


```
like image 839
Bridgeport Byron Tucker Avatar asked May 21 '16 23:05

Bridgeport Byron Tucker


People also ask

How do I add a sidebar to my Flexdashboard?

You add an input sidebar to a flexdashboard by adding the {. sidebar} attribute to a column, which indicates that it should be laid out flush to the left with a default width of 250 pixels and a special background color.

How do you make a Flexdashboard in R?

Create Flexdashboard Layout Initialize a Flexdashboard from R Studio using File > New File > R markdown > From Template > Flex Dashboard, save, and knit the document.


1 Answers

This issue has been resolved here: https://github.com/rstudio/flexdashboard/issues/27

You can use a version with the fix by installing the latest version from GitHub:

devtools::install_github("rstudio/flexdashboard")

Alternatively, you could add this snippet of CSS to your dashboard:

<style type="text/css"> .sidebar { overflow: auto; } </style>
like image 88
JJ Allaire Avatar answered Oct 02 '22 11:10

JJ Allaire