Hover color of actionlinks

Hi Everyone,

I am questioning regarding adding hover style/color to the action links. I searched the entire web but I couldn't find even a single solution, Java, CSS code for this purpose. Can you please advise me if it is possible and how to achieve that?

Thanks in advance,
Adrian

Here I used tags$style to do inline css, though there are many alternatives.


ui <- fluidPage(
  sliderInput("obs", "Number of observations", 0, 1000, 500),
  actionLink("goLink", "Go!"),
  tags$style("#goLink {
  background:black;
  color:yellow;
  font-size:20rem;}
    #goLink:hover {
  background-color: yellow;
             color:black;}"),
  plotOutput("distPlot")
)

server <- function(input, output) {
  output$distPlot <- renderPlot({
    # Take a dependency on input$goLink. This will run once initially,
    # because the value changes from NULL to 0.
    input$goLink
    
    # Use isolate() to avoid dependency on input$obs
    dist <- isolate(rnorm(input$obs))
    hist(dist)
  })
}

shinyApp(ui, server)

Hi Geaham,

Thank you very much.

It solved my problem. So easy! Is it also possible to add the hover style in the "style" argument of a tag (e.g. a link tag)?

Thanks in advance,
Adrian

This topic was automatically closed 7 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.