Table (reactable)
#| standalone: true
#| components: [viewer]
#| viewerHeight: 200
library(shiny)
library(bslib)
library(reactable)
library(palmerpenguins)
ui <- page_fluid(
  reactableOutput("table") 
)
server <- function(input, output) {
  output$table <- renderReactable({reactable(penguins)}) 
}
shinyApp(ui = ui, server = server)library(shiny)
library(bslib)
library(reactable)
library(palmerpenguins)
ui <- page_fluid(
  reactableOutput("table") 
)
server <- function(input, output) {
  output$table <- renderReactable({reactable(penguins)}) 
}
shinyApp(ui = ui, server = server)Relevant Functions
- 
    reactableOutput 
 reactableOutput(outputId, width = "auto", height = "auto", inline = FALSE)
- 
    renderReactable 
 renderReactable(expr, env = parent.frame(), quoted = FALSE)
Details
To make a reactive interactive table with reactable, follow these steps:
- Install ( - install.packages("reactable")) and load (- library(reactable)) the reactable package.
- Call - reactableOutput()in the UI of your app to create a div in which to display the table. Where you call this function within the UI functions will determine where the gt table will appear within the layout of the app. Set the- outputIdargument of- reactableOutput()to a unique value.
- Optionally, use the - height,- width, and- inlinearguments of- reactableOutput()to control the appearance and positioning of the table.
- Within the server function, call - renderReactable()and save its output as an element of the- outputlist. Name the element after the- outputIdused above. For example,- output$table <- renderReactable().- reactableOutput()will display the value of the- outputelement whose name matches its- outputId.
- Pass - renderReactable()a block of code, surrounded with- {}, that returns a reactable widget. Use- reactable()’s arguments to control the appearance and behavior of the table.
 COMPONENTS
COMPONENTS