v0.4.0
Documentation - reactable 0.4.0
New features
- Experimental support for rendering tables to static HTML in R. Use
reactable(static = TRUE)
to render a table to static HTML, oroptions(reactable.status = TRUE)
to enable static rendering globally. With static rendering, tables are pre-rendered to their initial HTML so they appear immediately without any flash of content. Tables are then made interactive and subsequently rendered by JavaScript as needed. Static rendering requires the V8 package, which is not installed with reactable by default. Learn more in the Static Rendering article. reactable()
gains ameta
argument to pass arbitrary data from R to JavaScript render functions and style functions. Custom metadata can be accessed using thestate.meta
property, and updated usingupdateReactable()
in Shiny orReactable.setMeta()
in the JavaScript API. See examples of using custom metadata for custom rendering or custom metadata for conditional styling. (#255)- New
Reactable.onStateChange()
method in the JavaScript API that sets up a function to be called whenever the table state changes. (#265) - New
Reactable.setData()
method in the JavaScript API for updating the table data. (#278) Reactable.downloadDataCSV()
in the JavaScript API now supports an additionaloptions
argument to change the field or decimal separator, include specific columns, and exclude column headers. (#239, #293)- New
Reactable.getDataCSV()
method in the JavaScript API to get the table data as a CSV string. - New
Reactable.toggleHideColumn()
andReactable.setHiddenColumns()
methods in the JavaScript API to toggle or set hidden columns. JavaScript render functions and style functions also receive a newstate.hiddenColumns
property for the hidden columns in the table. (#246) getReactableState()
now includes the current sorted columns. (#265)
Minor improvements and bug fixes
- Updated the documentation site for Internet Explorer 11 (IE 11) deprecation, Bootstrap 5 theming, and better accessibility. Examples now use modern JavaScript features that aren't supported in IE 11, like template literals and arrow functions. Examples now also use scalable font sizes and length units where appropriate (i.e.,
rem
/em
instead ofpx
). The documentation site uses the default root font size of16px
, so examples may look different on pages that change the root font size. For example, Bootstrap 3 sets a default root font size of10px
, so you may need to adjust therem
values before adapting examples to your site. (Bootstrap 4 and above no longer change the default root font size). - R style functions no longer apply to aggregated cells and rows incorrectly. (@fawda123, #250)
- JavaScript render functions and style functions no longer receive an invalid
cellInfo.index
orrowInfo.index
property for aggregated cells and rows. (#250) - Column group header widths are now calculated correctly with hidden columns in the column group. (@Patrikios, #253)
NULL
values in list-columns now correctly appear as missing values instead of[object Object]
.NULL
values are now represented asnull
values in JavaScript instead of an empty object like {}.reactableTheme()
styles no longer override custom user CSS in the HTML document<head>
.getReactableState()
now accepts multiple values in itsname
argument to return a subset of state values.reactable()
now respectshtmlwidget::sizingPolicy()
'sviewer.fill
andbrowser.fill
and fills the RStudio Viewer pane by default. (@cpsievert, #280)- Using
reactable()
on a dplyr grouped data frame (dplyr::group_by()
orgrouped_df
) withrownames = TRUE
no longer adds astringsAsFactors
column to the table. (@daattali, #283)
Breaking changes
-
Numeric
NA
values are now represented asnull
in JavaScript instead of an"NA"
string. NumericNaN
,Inf
, and-Inf
values are now represented asNaN
,Infinity
, and-Infinity
in JavaScript instead of"NaN"
,"Inf"
, and"-Inf"
strings. (@daattali, #261)function(cellInfo) { // Old cellInfo.value // "NA", "NaN", "Inf", "-Inf" // New cellInfo.value // null, NaN, Infinity, -Infinity }
-
Support for Internet Explorer 11 (IE 11) is deprecated. Existing features will continue to work in IE 11, but new features may not support IE 11, and IE 11 is no longer tested.
-
The documentation website no longer supports IE 11.