% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/busy-indicators.R
\name{useBusyIndicators}
\alias{useBusyIndicators}
\title{Use and customize busy indicator types.}
\usage{
useBusyIndicators(spinners = TRUE, pulse = TRUE)
}
\arguments{
\item{spinners}{Overlay a spinner on each calculating/recalculating output.}

\item{pulse}{Show a pulsing banner at the top of the window when the server is busy.}
}
\description{
To enable busy indicators, include the result of this function in the app's UI.
}
\details{
When both \code{spinners} and \code{pulse} are set to \code{TRUE}, the pulse is disabled
when spinner(s) are active. When both \code{spinners} and \code{pulse} are set to
\code{FALSE}, no busy indication is shown (other than the gray-ing out of
recalculating outputs).
}
\examples{
\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}

library(bslib)

ui <- page_fillable(
  useBusyIndicators(),
  card(
    card_header(
      "A plot",
      input_task_button("simulate", "Simulate"),
      class = "d-flex justify-content-between align-items-center"
    ),
    plotOutput("p"),
  )
)

server <- function(input, output) {
  output$p <- renderPlot({
    input$simulate
    Sys.sleep(4)
    plot(x = rnorm(100), y = rnorm(100))
  })
}

shinyApp(ui, server)
\dontshow{\}) # examplesIf}
}
\seealso{
\code{\link[=spinnerOptions]{spinnerOptions()}} \code{\link[=pulseOptions]{pulseOptions()}}
}
