0

I am writing a report in R Markdown using shiny runtime. It has four main sections which I want to make accessible through the tabset functionality. However, I would really like to embed buttons in each individual section which allows you to jump to another section.

A minimal example is included below, where I tried to follow this example but it doesn't seem to work outside of the flexdashboard setup. To make things even more complex, I would like to be able to trigger switching sections on an observeEvent-type of way. Specifically, I'm trying to include some simple barplots in some of the sections which, when clicked on, bring the user to another section.

Any help is greatly appreciated!

---
title: "Example Report"
output:
  html_document
runtime: shiny
---

# {.tabset .tabset-fade .tabset-pills}

## A. {#mytab1}

 ```{r, echo = FALSE}
tags$a(href = "#section-mytab2",
  shiny::actionButton("btn1", "go to mytab2")
       )
    ```

### Summary

### Methodology

## B. {#mytab2}

### Summary

### Methodology

## C. {#mytab3}

### Summary

### Methodology

## D. {#mytab4}

### Summary

### Methodology
Mark Verhagen
  • 239
  • 1
  • 11
  • when you create the `tabset`, there are already 4 buttons you can click to switch between tabs. Why don't you want to use these? – lz100 Dec 03 '21 at 00:18
  • I of course understand that.. I want to include additional buttons in the text below as I indicate in the question, in this case because it might be clear exactly where to navigate... – Mark Verhagen Dec 04 '21 at 10:22

0 Answers0