Skip to content

Feature request: programmatic value box styling for OJS dashboards #14158

@CoryMcCartan

Description

@CoryMcCartan

Currently, value boxes in Quarto dashboards can be programmatically customized in R and Python, as in this example from the docs:

```{python}
#| content: valuebox
#| title: "Comments per day"
dict(
  icon = "chat",
  color = "primary",
  value = comments
)
```

```{r}
#| content: valuebox
#| title: "Spam per day"
list(
  icon = "trash",
  color = "danger",
  value = spam
)
```

The OJS engine works really well with Quarto dashboards, as it allows for interactivity without a server and with much better responsiveness than Shiny or Shinylive.

It would be great if we could do something like the following in dashboards and have the same output as above:

```{ojs}
//| content: valuebox
//| title: "Comments per day"
({
  icon: "chat",
  color: "primary",
  value: comments
})
```

The parentheses are needed for OJS. Here, comments would be another variable defined in another OJS cell or from R/Python with ojs_define.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions