Learn R Programming

reactable.extras

Extra features for reactable package

reactable.extras is an R package that enhances the functionality of the reactable package in Shiny applications. Reactable tables are interactive customizable, and reactable.extras extend their capabilities, allowing you to create dynamic and interactive data tables with ease.

In the context of web apps, you often need to provide users with additional tools and interactivity for data exploration. reactable.extras address this need by offering a set of functions and components that can be seamlessly integrated into your Shiny apps.

How to install?

Stable version:

install.packages("reactable.extras")

Development version:

remotes::install_github("Appsilon/reactable.extras")

How to use it?

Getting started with reactable.extras is straightforward:

  1. Make sure you have latest version of {reactable}. It's required to be at least on version 0.4.0
  2. Include the necessary functions and components in your Shiny UI definition.
  3. Use the provided functions to enhance your reactable tables. You can add custom buttons, checkboxes, date pickers, dropdowns, and text inputs to your table cells.
  4. Customize the behavior and appearance of these input components based on your application's requirements.
  5. Implement server-side processing and pagination controls for large datasets.
library(shiny)
library(reactable)
library(reactable.extras)

data <- data.frame(
  ID = 1:1000,
  SKU_Number = paste0("SKU ", 1:1000),
  Actions = rep(c("Updated", "Initialized"), times = 20),
  Registered = as.Date("2023/1/1")
)

ui <- fluidPage(
  # Include reactable.extras in your UI
  reactable_extras_dependency(),
  reactableOutput("my_table")
)

server <- function(input, output, session) {
  output$my_table <- renderReactable({
    # Create a reactable table with enhanced features
    reactable(
      data,
      columns = list(
        ID = colDef(name = "ID"),
        SKU_Number = colDef(name = "SKU_Number"),
        Actions = colDef(
          name = "Actions",
          cell = button_extra("button", class = "btn btn-primary")
        ),
        Registered = colDef(
          cell = date_extra("Registered", class = "date-extra")
        )
      )
    )
  })

  observeEvent(input$button, {
    showModal(modalDialog(
      title = "Selected row data",
      reactable(data[input$button$row, ])
    ))
  })

}

shinyApp(ui, server)

How to contribute?

If you want to contribute to this project please submit a regular PR, once you're done with new feature or bug fix.

Reporting a bug is also helpful - please use GitHub issues and describe your problem as detailed as possible.

Appsilon

Appsilon is a Posit (formerly RStudio) Full Service Certified Partner. Learn more at appsilon.com.

Get in touch opensource@appsilon.com

Explore the Rhinoverse - a family of R packages built around Rhino!

Copy Link

Version

Install

install.packages('reactable.extras')

Monthly Downloads

963

Version

0.2.0

License

LGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Recle Vibal

Last Published

November 23rd, 2023

Functions in reactable.extras (0.2.0)

date_extra

Date input for reactable column cell
reactable-extras-server

Create reactable UI with server-side processing
text_extra

Text input for reactable column cell
dropdown_extra

Select input for reactable column cell
reactable_extras_dependency

Reactable.extras JS and CSS dependencies
get_data_on_page

Get the data on the page
checkbox_extra

Checkbox input for reactable column cell
reactable-page-controls

Module for reactable page navigation
button_extra

Button input for reactable column cell
tooltip_extra

Tool-tip for table headers
define_key

Define the unique id to use when passing values to shiny
toggle_navigation_buttons

Utility function to disable or re-enable navigation buttons