rstudio / rstudio/flexdashboard

valueBox arguments inconsistent

Open
#283 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
848
Forks
298
PR merge metrics
No merged PRs in 30d

Description

Both flexdashboard and shinydashboard have valueBox function, with similar arguments, in one we need to use icon = "fa-calendar" in the other icon = icon("calendar"), one has caption the other has subtitle, maybe harmonise them?

flexdashboard::valueBox(value, caption = NULL, icon = NULL, color = NULL, href = NULL)
shinydashboard::valueBox(value, subtitle, icon = NULL, color = "aqua", width = 4, href = NULL)

Related SO post
See example:

flexdashboard test.rmd


---
title: "My Icon"
output: 
  flexdashboard::flex_dashboard
---

```{r}
library(flexdashboard)
valueBox(42, caption = "my caption", icon = "fa-calendar")
```

Output:

image

shinydashboard

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    valueBox(42, "My Icon", icon = icon("calendar")),
  )
)

server <- function(input, output) { }

shinyApp(ui, server)

Output:

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the valueBox entry points in flexdashboard and shinydashboard, using the supplied test.rmd example and the comparable shinydashboard snippet to compare argument names and icon handling. Decide the harmonized API before changing it; done means the two valueBox interfaces behave consistently for the demonstrated caption/subtitle and icon use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.