% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/govReactable.R
\name{govReactable}
\alias{govReactable}
\title{Interactive govTable}
\usage{
govReactable(
  df,
  right_col = NULL,
  page_size = 10,
  highlight = TRUE,
  borderless = TRUE,
  min_widths = list(),
  ...
)
}
\arguments{
\item{df}{A dataframe used to generate the table}

\item{right_col}{A vector of column names that should be right-aligned.
By default, numeric data is right-aligned, and character data is
left-aligned}

\item{page_size}{The default number of rows displayed per page (default: 10)}

\item{highlight}{Highlight table rows on hover}

\item{borderless}{Remove inner borders from table}

\item{min_widths}{Customise minimum column width using a list of columns and
minimum width in pixels}

\item{...}{Additional arguments passed to \code{reactable::reactable}}
}
\value{
A \code{reactable} HTML widget styled with GOV.UK classes
}
\description{
This function is opinionated and sets table defaults that are in
keeping with the wider GOV.UK design system. Some defaults are overrideable,
such as \code{highlight=TRUE} and \code{borderless=TRUE}, however some are fixed, such
as \code{showSortIcon=FALSE} as the default sort icon is inaccessible. Additional
arguments from \code{reactable::reactable} can be passed to customise the table.
}
\details{
This function inserts a government-styled table using \code{reactable}.
You can use this in R markdown or Quarto documents, or use
renderGovReactable({}) and govReactableOutput() for tables in R Shiny.
govReactableOutput() gives the ability to add a caption, for static
tables made using just govReactable(), use heading_text() to add
captions to tables.
}
\examples{
# Example static table using govReactable
if (interactive()) {
  govReactable(
    iris,
    right_col = c(
      "Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"
    )
  )

  govReactable(
    iris,
    right_col = c(
      "Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"
    ),
    highlight = FALSE,
    page_size = 5,
    min_widths = list(
      Sepal.Length = 75,
      Sepal.Width = 75,
      Petal.Length = 75,
      Petal.Width = 75
    )
  )
}
}
\seealso{
Other Govstyle tables tabs and accordions: 
\code{\link{accordion}()},
\code{\link{govReactable-shiny}},
\code{\link{govTable}()},
\code{\link{govTabs}()}
}
\concept{Govstyle tables tabs and accordions}
