To bypass this issue, I am trying to store tippy tooltips in a data.frame column and render them in reactable without using the cell attribute in colDef. I tried the following example to show tooltips with dogs pictures when hovering on the dog name, unsuccessfully. Any suggestions?
library(shiny); library(tidyverse); library(tippy)
ui <- fluidPage(
titlePanel("Reactable and pop-ups"),
reactableOutput("table")
)
server <- function(input, output) {
df <- data.frame(dog_name=c("Fred", "Joe"),
dog_pic=c("https://images.pexels.com/photos/406014/pexels-photo-406014.jpeg", "https://images.pexels.com/photos/39317/chihuahua-dog-puppy-cute-39317.jpeg")
) %>% rowwise() %>%
mutate(dog_name=tippy(dog_name, div(dog_pic)) %>% htmltools:::as.character.shiny.tag.list()) %>%
ungroup()
output$table <- renderReactable(reactable(df,
columns = list(
dog_name=colDef(html = TRUE, name="Dog"),
dog_pic=colDef(show = FALSE))))
}
shinyApp(ui = ui, server = server)