Search code examples
htmlrtwitter-bootstrapr-markdownblogdown

How to add dropdown menu on tab / tabset [rmarkdown / bootstrap]


Documentation for Bootswatch suggests I can use a dropdown menu from a tab in a tabset:

enter image description here

How can I achieve this with Rmarkdown? I've tried:

# SECTION 1 {.tabset .tabset-fade}

## Section 1.1 

## Section 1.2 {????something here?????}
 ### Section 1.2.1  <<<<<<<<< want this to appear under the dropdown menu

Solution

  • This is now available within the development version of rmarkdown, which you can install this via devtools::install_github("rstudio/rmarkdown"). To add a dropdown menu, you must add .tabset-dropdown to the class header as follows:

    ---
    output: html_document
    ---
    
    # Heading {.tabset .tabset-dropdown}
    
    ## Dropdown 1
    
    ## Dropdown 2
    
    ## Dropdown 3 
    
    ## Dropdown 4
    

    enter image description here enter image description here