Making Tabs interactive

Hi Experts here. Is there a way to make tables interactive as per the selection. For example in my code below, "Parameters tab should be displayed only when A is selected from the filter". Is this feature possible?

---
title: "Untitled"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: scroll
    runtime: shiny
---


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

```{r}

```


Summary
=================

Inputs {.sidebar}
-----------------------------------------------------------------------
```{r}
selectInput("S","S1",choices = c("A","B"),selected = "B")
```


Column {data-width=300}
-----------------------------------------------------------------------

### Chart A

```{r}

```

Row {.tabset .tabset-fade}
-----------------------------------------------------------------------

### Performance {data-height=2000}


```{r}

```

### Parameters {data-height=1000}

```{r}

```
1 Like

I don't think it would be straightforward to implement this behavior, at least not using this strategy. The tabs are defined in the plain text section of the R Markdown document (i.e. Row {.tabset .tabset-fade} and the level 3 headers after it). In contrast, the input the user selects that gets passed to selectInput() is part of the Shiny app server logic, not the user interface.

As a related example, this StackOverflow post asked how to dynamically change the number of tabs, and the only answer was to use an R chunk to output the necessary plain text. This strategy wouldn't work in this case because you want the tabs to change any time the user selects a different input.

1 Like

Thanks for the suggestion

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.