Learn R Programming

reactable (version 0.2.0)

reactableLang: 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}{rowEnd} of {rows} rows",
  pageSizeOptions = "Show {rows}",
  pageNextLabel = "Next page",
  pagePreviousLabel = "Previous page",
  pageNumberLabel = "Page {page}",
  pageJumpLabel = "Go to page",
  pageSizeOptionsLabel = "Rows per page",
  defaultGroupHeader = "Grouped",
  detailsExpandLabel = "Expand details",
  detailsCollapseLabel = "Collapse details",
  selectAllRowsLabel = "Select all rows",
  deselectAllRowsLabel = "Deselect all rows",
  selectAllSubRowsLabel = "Select all rows in group",
  deselectAllSubRowsLabel = "Deselect all rows in group",
  selectRowLabel = "Select row",
  deselectRowLabel = "Deselect row"
)

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.

defaultGroupHeader

Header for default column groups. Only used for groupBy columns.

detailsExpandLabel

Accessible label for the row details expand button.

detailsCollapseLabel

Accessible label for the row details collapse button.

selectAllRowsLabel

Accessible label for the select all rows checkbox.

deselectAllRowsLabel

Accessible label for the deselect all rows checkbox.

selectAllSubRowsLabel

Accessible label for the select all sub rows checkbox.

deselectAllSubRowsLabel

Accessible label for the deselect all sub rows checkbox.

selectRowLabel

Accessible label for the select row checkbox

deselectRowLabel

Accessible label for the deselect row checkbox.

Value

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

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab