I am trying to utilize valueBox
in flexdashboard
to display a headline figure. However, I also want the valueBox
to act like an actionButton
, in that clicking the valueBox
should trigger an action elsewhere in the dashboard.
In checking the flexdashboard
documentation, I see the following relevant bit for valueBox
:
Linked Value Box
valueBox(42, icon = "fa-pencil", href="#details")
wherein clicking the valueBox
will navigate the user to a different page with an anchor of "#details." However, there is nothing to indicate that clicking the valueBox
could be used for other actions.
Below is a minimal relevant flexdashboard code
---
title: "valueBox Links"
output:
flexdashboard::flex_dashboard:
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
```
Tab 1 - Test
======================================================================
Column
-------------------------------------
#### Three valueBoxes
### valueBox 1
```{r}
valueBox(1)
```
### valueBox 2
```{r}
valueBox(2)
```
### valueBox 3
```{r}
valueBox(3)
```
Column
-------------------------------------
### Text output
This is where I want some text to show up dynamically, depending on if the user has clicked valueBox 1, 2, or 3.
Any help would be appreciated :)