% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dt2_options.R
\name{dt2_use_buttons}
\alias{dt2_use_buttons}
\title{Enable Buttons (extension) and define buttons}
\usage{
dt2_use_buttons(
  options = list(),
  buttons = c("copy", "csv", "excel", "print"),
  position = "topEnd",
  button_class = NULL
)
}
\arguments{
\item{options}{Options list.}

\item{buttons}{Vector of button ids (e.g., c("copy","csv","excel","print","colvis")).}

\item{position}{Where to place buttons in the layout.
One of \code{"topEnd"} (default), \code{"topStart"}, \code{"bottomEnd"},
\code{"bottomStart"}.}

\item{button_class}{CSS class for buttons (e.g., \code{"btn btn-sm btn-primary"}).
If \code{NULL}, uses the theme default (\code{"btn btn-sm btn-outline-secondary"}).
Applied per-button via \code{className}.}
}
\value{
Updated \code{options}.
}
\description{
Uses the modern DataTables 2.x \code{layout} API (not the deprecated \code{dom}).
}
\examples{
opts <- dt2_use_buttons(list(), buttons = c("copy", "csv", "excel"))
dt2(mtcars, options = opts)
}
\seealso{
\code{\link[=dt2_buttons]{dt2_buttons()}} for a lower-level variant that takes full button
objects and can relocate the buttons container to a custom CSS selector.
}
