Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Scrolling on only some pages in Quarto dashboard

In Quarto we have the scrolling option for Dashboards which can be really usefull. But this will be applied to all pages on your dashboard. I would like to have this only on some pages. Here I created a simple reproducible example:

---
title: "Scrolling"
format: 
  dashboard:
    scrolling: true 
---
       
# Page 1

```{r}
head(mtcars)
```

```{r}
plot(mtcars$mpg, mtcars$cyl)
```


# Page 2
    
```{r}
plot(mtcars$carb, mtcars$vs)
```

enter image description here

On Page 1 the scrolling option is really useful since we have multiple items, but on Page 2 I don’t want a scrolling option because not necessary (this is really simple example). So I was wondering how we can use the scrolling option on only some pages in Quarto Dashboards?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can set the scrolling property at the page level using the Pandoc fenced div notation. For example:

---
title: "Scrolling"
format: 
  dashboard:
    scrolling: false 
---
       
# Page 1 {scrolling="true"}

```{r}
head(mtcars)
```

```{r}
plot(mtcars$mpg, mtcars$cyl)
```


# Page 2
    
```{r}
plot(mtcars$carb, mtcars$vs)
```

Output

Page 1 (scrollable):

enter image description here

Page 2 (fitted to page):

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading