reactable.extras
reactable.extras copied to clipboard
[Feature]: render HTML in button_extra
Guidelines
- [X] I agree to follow this project's Contributing Guidelines.
Description
Hello,
I want to use button_extra
with some HTML inside the buttons. However that doesn't work, even with html=TRUE
in colDef
. If I remove cell = button_extra(...
, the HTML is correctly rendered, but with cell=button_extra(...
, the HTML code appears inside the buttons.
library(shiny)
library(reactable)
library(reactable.extras)
library(fontawesome)
df <- MASS::Cars93[, 1:4]
df$view_item <- '<i class="fa-solid fa-eye"></i>'
ui <- fluidPage(
reactable_extras_dependency(),
fa_html_dependency(),
reactableOutput("table")
)
server <- function(input, output, session) {
output$table <- renderReactable({
reactable(
df,
columns = list(
view_item = colDef(
html = TRUE,
cell = button_extra(id = "button", class = "button-extra")
)
)
)
})
observe({
print(input$button)
})
}
shinyApp(ui, server)
Problem
The problem is that the HTML code is rendered inside the button.
Proposed Solution
I have no idea about the solution.
Alternatives Considered
I don't know whether there are some alternatives.