Skip to contents

Builds a reactable::reactableTheme() from one of the 122 surveyed table styles listed by sdv_table_themes(): the text, background, hairline, stripe and hover colors, the header label style, the body font and the cell padding come from the theme's spec (table_theme_spec()).

Usage

reactable_sdv_theme(name, mode = "light")

Arguments

name

A registry theme id, for example "wikipedia", "datagolf" or "nejm".

mode

"light" (default) or "dark". "dark" on a light-only theme is an error that names three dark-capable themes in the same category.

Value

A reactableTheme object.

Details

The 27 themes of 'reactablefmtr' ("espn", "nytimes", "fivethirtyeight", ...) are not rebuilt here: call reactablefmtr::<name>() for those. Three of their names ("espn", "fivethirtyeight", "pff") are also sites in the registry; the surveyed look of those is "espn-site", "fivethirtyeight-site" and "pff-site".

The theme does not load a font. Pass the result to reactable(theme = ).

Examples

library(reactable)
df <- data.frame(team = c("KC", "BUF", "BAL"), wins = c(12, 10, 9))
reactable(df, theme = reactable_sdv_theme("wikipedia"))
reactable(df, theme = reactable_sdv_theme("datagolf", mode = "dark"))