You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot pass this reactive like title, value, etc. arguments (bslib::value_box(theme = shiny::textOutput('status')), because even when the reactive would return a simple string like "success" (a valid input to theme), bslib::value_box() isn't set up internally to deal with a reactive, and there is no textOutput/renderText equivalent to the CSS side-effects of applying a theme.
I guess I could use shiny::renderUI for the whole value box, but that defeats the awesomeness of the bslib::value_box()es, which is to do as small a change to the DOM as possible.
(The UX of shinydashboard, which could only render entire value boxes was lacking because of it.
The only other way to accomplish dynamically rendering of value box styling I can think of is to use shinyjs::addClass().
This should work but might for the issue in question, but could end up being quite cumbersome if I want to do more complex stuff with bootstrap.
Maybe it could be done with a good wrapper.
I'm thinking it might be useful to have a wrapper package (?) around bslib which wraps all elements (such as bslib::value_box()as shiny modules and exposes all the styling options as module server inputs, ready for reactives.
Though I'm not sure how much work it would be to do this, since it would require carefully syncing the DOM with reactives via shinyjs::addClass() (or friends).
Anyway, I'm rambling.
Before jumping in on any of this I wanted to hear what others and the creators of bslib thought about this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd like to dynamically render the
theme
argument tobslib::value_box()
, say with a reactiveI cannot pass this reactive like
title
,value
, etc. arguments (bslib::value_box(theme = shiny::textOutput('status')
), because even when the reactive would return a simple string like"success"
(a valid input totheme
),bslib::value_box()
isn't set up internally to deal with a reactive, and there is notextOutput
/renderText
equivalent to the CSS side-effects of applying a theme.I guess I could use
shiny::renderUI
for the whole value box, but that defeats the awesomeness of thebslib::value_box()
es, which is to do as small a change to the DOM as possible.(The UX of shinydashboard, which could only render entire value boxes was lacking because of it.
The only other way to accomplish dynamically rendering of value box styling I can think of is to use
shinyjs::addClass()
.This should work but might for the issue in question, but could end up being quite cumbersome if I want to do more complex stuff with bootstrap.
Maybe it could be done with a good wrapper.
I'm thinking it might be useful to have a wrapper package (?) around bslib which wraps all elements (such as
bslib::value_box()
as shiny modules and exposes all the styling options as module server inputs, ready for reactives.Though I'm not sure how much work it would be to do this, since it would require carefully syncing the DOM with reactives via
shinyjs::addClass()
(or friends).Anyway, I'm rambling.
Before jumping in on any of this I wanted to hear what others and the creators of bslib thought about this.
Beta Was this translation helpful? Give feedback.
All reactions