I came across this question and it got me thinking - how can I give unique styles to different tooltips in my Shiny app?
For instance, if I have a set of buttons, I would like each button to have its own distinct background color, font color, or font style.
Mere repetition of the code doesn't seem to do the trick
actionButton("button1", "Click button 1"),
bsTooltip("button1",
"Button 1 Tooltip",
placement = "bottom", trigger = "hover",
options = NULL),
tags$style(HTML("
.tooltip > .tooltip-inner {
width: 1000px;
color: black;
background-color: yellow;
opacity: 1;
}"
))
actionButton("button2", "Click button 2"),
bsTooltip("button2",
"Button 2 Tooltip",
placement = "bottom", trigger = "hover",
options = NULL),
tags$style(HTML("
.tooltip > .tooltip-inner {
width: 600px;
color: white;
background-color: darkblue;
opacity: 1;
}"
))
actionButton("button3", "Click button 3"),
bsTooltip("button3",
"Button 3 Tooltip",
placement = "bottom", trigger = "hover",
options = NULL),
tags$style(HTML("
.tooltip > .tooltip-inner {
width: 1000px;
color: white;
background-color: red;
opacity: 1;
}"
))
So, what's the solution to this challenge?