I would like to create a dropdown menu in Quarto
to show multiple plots. In R Markdown
is this really simple using # Dropdown menu {.tabset .tabset-dropdown}
with some ##
for each plot. Here is a reproducible example in R markdown:
---
title: "Dropdown menu in Rmarkdown"
date: "2022-08-29"
output: html_document
---
# Dropdown menu {.tabset .tabset-dropdown}
## Plot 1
```{r, echo=FALSE}
plot(1:10, 10:1)
```
## Plot 2
```{r, echo=FALSE}
hist(rnorm(100))
```
## Plot 3
```{r, echo=FALSE}
plot(rnorm(10), rnorm(10))
```
Output:
As you can see in the output there is a dropdown menu to show each plot separately. I found some information about Tabsets section in Quarto
and maybe thought that using ::: {.tabset-dropdown})
would do the job. I tried the following code in a .tabset-dropdown
:
---
title: "Dropdown menu in Quarto"
format: html
---
::: {.tabset-dropdown}
## plot1
```{r}
plot(1:10, 1:10)
```
## plot2
```{r}
hist(rnorm(100))
```
:::
Output:
As you can see in the output, it didn't create a dropdown menu like in R Markdown. So I was wondering if it is possible to achieve the same in Quarto
?