Skip to main content
v2026.11,986 entries · CC-BY 4.0

reactable: Interactive Tables in R for Research Data

How to install reactable from CRAN, build sortable, filterable, grouped R tables from a data frame, and read the output, with documented code.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

reactable is an R package that turns a data frame into an interactive HTML table with sorting, filtering, searching, pagination, row grouping, expandable rows and conditional styling, built on the React Table JavaScript library. It is written and maintained by Greg Lin, released under the MIT license, and installed from CRAN with install.packages("reactable"). This guide covers what it does for research data, how to install it, a step-by-step walk-through using the built-in iris dataset, how to read the output, and what to do when a table does not render. The name is also used for a separate Python port on PyPI; everything here concerns the R package documented at glin.github.io/reactable.

What reactable is used for in research

Researchers use reactable to put a data frame in front of a reader who needs to explore it rather than scan a static printout: a supplementary table in an HTML report, a codebook preview, a results summary in an R Markdown document, or the table panel of a Shiny application. The package documentation lists the capabilities: sorting, filtering and pagination; grouping and aggregation; built-in column formatting; custom rendering in R or JavaScript; expandable rows and nested tables; conditional styling; virtual scrolling for long tables; and use in R Markdown and Shiny.

It is an output tool, not an analysis tool. It does not fit models or compute statistics beyond the aggregation functions you ask for on grouped columns. Because it produces interactive HTML, it suits web-based reports; a print or Word deliverable needs a static table package instead (see flextable for tabular reporting in R).

How to install or access it

The package is distributed on CRAN. On the CRAN package page (read 2026-11-13), the current release is version 0.4.5, published 2025-12-01, with an MIT + file LICENSE license. It depends on R (>= 3.1) and imports digest, htmltools (>= 0.5.2), htmlwidgets (>= 1.5.3), jsonlite and reactR. Install the released version from inside R:

install.packages("reactable")

The project site also documents installing the development version from GitHub:

devtools::install_github("glin/reactable")

Load the package with library(reactable). Pin the version in your project environment (for example with a lockfile) if the table must render identically when a report is rerun later; see reproducibility for why that matters.

Step-by-step: build an interactive table

1. Create a basic table

Pass a data frame to reactable(). The documentation’s first example uses the built-in iris dataset (the same data frame is described in datasets in R packages):

library(reactable)
reactable(iris)

In an R Markdown document or the RStudio Viewer this renders a table you can sort, page through and resize.

2. Set the default sort

Sorting is on by default: clicking a column header sorts that column, and holding Shift while clicking adds a second sort column. To open the table already sorted, use defaultSorted, as in the documentation example:

reactable(iris[48:52, ], defaultSorted = c("Species", "Petal.Length"))

Related arguments listed in the examples page are sortNALast and sortable. To hide the sort arrow icons, the documentation uses reactable(iris[1:5, ], showSortIcon = FALSE).

3. Add filtering, searching and pagination

filterable = TRUE adds a filter box per column; searchable = TRUE adds one search box for the whole table. Pagination is controlled with defaultPageSize, pageSizeOptions, paginationType (documented values "jump" and "simple") and showPagination. The documentation’s search example uses a slice of MASS::Cars93:

data <- MASS::Cars93[1:20, c("Manufacturer", "Model", "Type", "AirBags", "Price")]
reactable(data, searchable = TRUE, minRows = 10)

For long tables, virtual = TRUE with a height enables virtual scrolling instead of pages.

4. Rename and configure columns

Column settings go in a named list passed to columns, with one colDef() per column; colDef(name = ...) changes the header label, and defaultColDef applies one setting to every column. Column groups use columnGroups with colGroup().

5. Format values

colFormat() supplies built-in formatting through the format argument of colDef(). These lines come straight from the documentation’s formatting example (they sit inside a columns = list(...) call on a data frame with those column names):

price_USD = colDef(format = colFormat(prefix = "$", separators = TRUE, digits = 2))
percent = colDef(format = colFormat(percent = TRUE, digits = 1))
date = colDef(format = colFormat(date = TRUE, locales = "en-GB"))

6. Group and aggregate

groupBy collapses rows into expandable groups, and each column’s aggregate says how to summarise it in the group row. The documentation example:

data <- MASS::Cars93[14:38, c("Type", "Price", "MPG.city", "DriveTrain", "Man.trans.avail")]
reactable(data, groupBy = "Type", columns = list(
  Price = colDef(aggregate = "max"),
  MPG.city = colDef(aggregate = "mean", format = colFormat(digits = 1)),
  DriveTrain = colDef(aggregate = "unique"),
  Man.trans.avail = colDef(aggregate = "frequency")
))

This is the pattern for a research summary: group by a design factor (treatment arm, site, species) and aggregate the measure columns.

7. Add expandable detail rows

The details argument takes a function of the row index and returns content shown when the row is expanded; defaultExpanded opens them at load:

reactable(iris[1:5, ], details = function(index) {
  htmltools::div(
    "Details for row: ", index,
    htmltools::tags$pre(paste(capture.output(iris[index, ]), collapse = "\n"))
  )
})

8. Style the table

Conditional styling uses style, rowStyle and rowClass; appearance options include highlight, bordered, striped and compact; theme with reactableTheme() sets global styles. sticky ("left" or "right") pins columns, and resizable lets readers resize them.

Use reactable in a Shiny app

The reference index lists the Shiny bindings: reactableOutput() and renderReactable() display a table in an app, updateReactable() changes a table’s state from the server, and getReactableState() reads its state (for example selected rows or the current page). For very large data, reactableServerInit(), reactableServerData() and resolvedData() support server-side backends. For the wider app structure, see building a Shiny interface.

Output and how to read it

The result is an HTML widget, not a changed data frame. What a reader sees: a header row with sort indicators; a body split into pages (or scrolled, if virtual scrolling is on); filter or search boxes if enabled; and, with groupBy, group rows showing the aggregate values you specified, which expand to the underlying rows. Sorting, filtering and paging change only the view; the source data in R is untouched, so the numbers in a grouped row are the aggregation function you chose ("max", "mean", "unique", "frequency"), not a statistical summary of record. State in your report which aggregate each column uses.

The data table below maps each task to the argument that controls it and the example dataset the official examples page uses for it, so you can find the right argument without reading the full gallery.

Troubleshooting

  • Error: could not find function “reactable”. The package is not loaded. Run library(reactable); if that errors, install it with install.packages("reactable").
  • Column settings are ignored. Per-column options belong inside columns = list(colname = colDef(...)), and the list names must match the data frame’s column names exactly ("Petal.Length", not "Petal Length").
  • A very large table is slow. Use virtual scrolling (virtual = TRUE with a height), a smaller defaultPageSize, or the server-side functions listed above.
  • No table in a non-HTML output. reactable produces an interactive HTML widget, so it needs an HTML target such as an R Markdown HTML document or a Shiny app.
  • Formatting looks wrong for dates or currency. Check the locales value inside colFormat(); the documentation examples use values such as "en-GB" and "hi-IN".

Free alternatives

All three packages below are open-source on CRAN. Versions and dates are from each package’s CRAN page, read on 2026-11-13.

Package CRAN version (date) License What the CRAN page says it is
reactable 0.4.5 (2025-12-01) MIT + file LICENSE Interactive tables built on React Table
DT 0.34.0 (2025-09-02) MIT + file LICENSE A wrapper for the JavaScript library DataTables, rendering R data as interactive HTML tables
gt 1.4.0 (2026-10-15) MIT + file LICENSE “Build display tables from tabular data with an easy-to-use set of functions”

For static, report-ready tables see flextable.

FAQ

What is reactable in R?

An R package by Greg Lin that creates interactive tables from data frames, built on the React Table library and licensed under MIT.

How do I install reactable?

Run install.packages("reactable") for the CRAN release (0.4.5 as of 2025-12-01), or devtools::install_github("glin/reactable") for the development version.

Does reactable work in Shiny and R Markdown?

Yes. The documentation states it works in both, and the Shiny bindings are reactableOutput() and renderReactable().

Can I filter and search a reactable table?

Yes: filterable = TRUE for per-column filters and searchable = TRUE for a global search box.

Is there a Python version?

A separate package with the same name exists on PyPI. It is a different project from the R package described here, and its API should be taken from its own documentation.

Sources

Data: reactable arguments by task, with the documentation example dataset

Maps common table tasks to the reactable() or colDef() argument that controls them, and the dataset the official examples page uses to demonstrate each. Compiled from the reactable examples page and function reference.

reactable arguments by task, with the documentation example dataset
TaskArgument or functionDocumentation example data
Set default sort orderdefaultSortediris
Hide sort iconsshowSortIcon = FALSEiris
Global search boxsearchable = TRUEMASS::Cars93
Group rowsgroupByMASS::Cars93
Summarise a grouped columncolDef(aggregate = ...)MASS::Cars93
Format numbers, dates, currencycolDef(format = colFormat(...))custom data frame
Expandable detail rowsdetailsiris
Display in a Shiny appreactableOutput() / renderReactable()reference index (no data)

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about reactable: Interactive Tables in R for Research Data

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →