Skip to contents

If using reactable, this helper constructs a theme.

Usage

reactable_theme(
  colour = "blue_01",
  text_colour = colour,
  borderColor = colour,
  backgroundColor = "white",
  base_family = "Public Sans",
  title_family = "Public Sans",
  base_text_size = 10,
  stripedColor = NA,
  ...
)

Arguments

colour

starting colour used only to set a common default for other colour parameters.

text_colour

colour of all text.

borderColor

colour for the horizontal lines between rows.

backgroundColor

background colour.

base_family

font family for normal text.

title_family

font family for title text.

base_text_size

base text size in pt. The header size is relative to the base text size.

stripedColor

fill colour for alternate rows. When NA, this is set to a blend of borderColor and backgroundColor.

...

other parameters to pass to reactable::reactableTheme(). For examples of what can be done with reactable, see https://glin.github.io/reactable/articles/cookbook/cookbook.html.

Value

A reactable theme object

Details

Colours can be specified as named NSW colours as in nsw_colours.

As normal with HTML elements, you must make sure that the final document loads the necessary fonts. See vignette("waratah") for instructions.

Examples

library(reactable)

# The default theme
head(palmerpenguins::penguins, 10) |>
  reactable(theme = reactableTheme())
# Adding waratah style head(palmerpenguins::penguins, 10) |> reactable(theme = reactable_theme())
# More customised styling head(palmerpenguins::penguins, 10) |> reactable( theme = reactable_theme( colour = "blue_01", base_family = "Arial", text_colour = "black", backgroundColor = NULL ), striped = TRUE )