reactableLang: Language options

View source: R/language.R

reactableLangR Documentation

Language options

Description

Use reactableLang() to customize the language strings in a table. Language strings include both visible text and accessible labels that can be read by assistive technology, such as screen readers.

To set the default language strings for all tables, use the global reactable.language option.

Usage

reactableLang(
  sortLabel = "Sort {name}",
  filterPlaceholder = "",
  filterLabel = "Filter {name}",
  searchPlaceholder = "Search",
  searchLabel = "Search",
  noData = "No rows found",
  pageNext = "Next",
  pagePrevious = "Previous",
  pageNumbers = "{page} of {pages}",
  pageInfo = "{rowStart}\u2013{rowEnd} of {rows} rows",
  pageSizeOptions = "Show {rows}",
  pageNextLabel = "Next page",
  pagePreviousLabel = "Previous page",
  pageNumberLabel = "Page {page}",
  pageJumpLabel = "Go to page",
  pageSizeOptionsLabel = "Rows per page",
  groupExpandLabel = "Toggle group",
  detailsExpandLabel = "Toggle details",
  selectAllRowsLabel = "Select all rows",
  selectAllSubRowsLabel = "Select all rows in group",
  selectRowLabel = "Select row",
  defaultGroupHeader = NULL,
  detailsCollapseLabel = NULL,
  deselectAllRowsLabel = NULL,
  deselectAllSubRowsLabel = NULL,
  deselectRowLabel = NULL
)

Arguments

sortLabel

Accessible label for column sort buttons. Takes a {name} parameter for the column name.

filterPlaceholder

Placeholder for column filter inputs.

filterLabel

Accessible label for column filter inputs. Takes a {name} parameter for the column name.

searchPlaceholder

Placeholder for the table search input.

searchLabel

Accessible label for the table search input.

noData

Placeholder text when the table has no data.

pageNext

Text for the next page button.

pagePrevious

Text for the previous page button.

pageNumbers

Text for the page numbers info. Only used with the "jump" and "simple" pagination types. Takes the following parameters:

  • {page} for the current page

  • {pages} for the total number of pages

pageInfo

Text for the page info. Takes the following parameters:

  • {rowStart} for the starting row of the page

  • {rowEnd} for the ending row of the page

  • {rows} for the total number of rows

pageSizeOptions

Text for the page size options input. Takes a {rows} parameter for the page size options input.

pageNextLabel

Accessible label for the next page button.

pagePreviousLabel

Accessible label for the previous page button.

pageNumberLabel

Accessible label for the page number buttons. Only used with the the "numbers" pagination type. Takes a {page} parameter for the page number.

pageJumpLabel

Accessible label for the page jump input. Only used with the "jump" pagination type.

pageSizeOptionsLabel

Accessible label for the page size options input.

groupExpandLabel

Accessible label for the row group expand button.

detailsExpandLabel

Accessible label for the row details expand button.

selectAllRowsLabel

Accessible label for the select all rows checkbox.

selectAllSubRowsLabel

Accessible label for the select all sub rows checkbox.

selectRowLabel

Accessible label for the select row checkbox.

defaultGroupHeader

Deprecated and no longer used.

detailsCollapseLabel

Deprecated and no longer used.

deselectAllRowsLabel

Deprecated and no longer used.

deselectAllSubRowsLabel

Deprecated and no longer used.

deselectRowLabel

Deprecated and no longer used.

Value

A language options object that can be used to customize the language strings in reactable().

Examples

reactable(
  iris[1:30, ],
  searchable = TRUE,
  paginationType = "simple",
  language = reactableLang(
    searchPlaceholder = "Search...",
    noData = "No entries found",
    pageInfo = "{rowStart}\u2013{rowEnd} of {rows} entries",
    pagePrevious = "\u276e",
    pageNext = "\u276f",

    # Accessible labels for assistive technology, such as screen readers
    pagePreviousLabel = "Previous page",
    pageNextLabel = "Next page"
  )
)

# Set the default language for all tables
options(reactable.language = reactableLang(
  searchPlaceholder = "Search...",
  noData = "No entries found",
  pageInfo = "{rowStart} to {rowEnd} of {rows} entries"
))

reactable(iris[1:30, ], searchable = TRUE)


reactable documentation built on May 28, 2022, 1:22 a.m.