jm_t
March 7, 2019, 12:29pm
1
Dear all,
For didactic reasons, I would like to define a different color for each of the inputs in my shiny app. Let's say 3 sliderInput.
What are my options? Include individual sliderInput into a tags$div with a style="color=something"? Define class and entry in my css? Use some packages?
Regards,
jm
jm_t
March 7, 2019, 1:04pm
2
Dear all,
Found a working solution using the shinyWidgets package.
See the code here:
#' @title Color editor for sliderInput
#'
#' @description Edit the color of the original shiny's sliderInputs
#'
#' @param color The \code{color} to apply. This can also be a vector of colors if you want to customize more than 1 slider. Either
#' pass the name of the color such as 'Chartreuse ' and 'Chocolate 'or the HEX notation such as \code{'#7FFF00'} and \code{'#D2691E'}.
#' @param sliderId The \code{id} of the customized slider(s). This can be a vector like \code{c(1, 2)}, if you want to modify the 2 first sliders.
#' However, if you only want to modify the second slider, just use the value 2.
#'
#' @note See also \url{https://www.w3schools.com/colors/colors_names.asp} to have an overview of all colors.
#'
#' @seealso See \code{\link{chooseSliderSkin}} to update the global skin of your sliders.
#'
#' @export
#'
#'
#' @examples
#' \dontrun{
#'
#' if (interactive()) {
This file has been truncated. show original
Still looking for other options, so feel free to add yours.
Regards,
jm
system
Closed
April 30, 2019, 5:04pm
3
This topic was automatically closed 54 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.