mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-29 03:00:45 -04:00
83 lines
2.3 KiB
R
83 lines
2.3 KiB
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/busy-indicators.R
|
|
\name{spinnerOptions}
|
|
\alias{spinnerOptions}
|
|
\title{Customize spinning busy indicators.}
|
|
\usage{
|
|
spinnerOptions(
|
|
type = NULL,
|
|
...,
|
|
color = NULL,
|
|
size = NULL,
|
|
easing = NULL,
|
|
speed = NULL,
|
|
delay = NULL,
|
|
css_selector = ":root"
|
|
)
|
|
}
|
|
\arguments{
|
|
\item{type}{The type of spinner to use. Builtin options include: tadpole,
|
|
disc, dots, dot-track, and bounce. A custom type may also provided, which
|
|
should be a valid value for the CSS
|
|
\href{https://developer.mozilla.org/en-US/docs/Web/CSS/mask-image}{mask-image}
|
|
property.}
|
|
|
|
\item{color}{The color of the spinner. This can be any valid CSS color.
|
|
Defaults to the app's "primary" color (if Bootstrap is on the page) or
|
|
light-blue if not.}
|
|
|
|
\item{size}{The size of the spinner. This can be any valid CSS size.}
|
|
|
|
\item{easing}{The easing function to use for the spinner animation. This can
|
|
be any valid CSS \href{https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function}{easing function}.}
|
|
|
|
\item{speed}{The amount of time for the spinner to complete a single
|
|
revolution. This can be any valid CSS time.}
|
|
|
|
\item{delay}{The amount of time to wait before showing the spinner. This can
|
|
be any valid CSS time and can useful for not showing the spinner
|
|
if the computation finishes quickly.}
|
|
|
|
\item{css_selector}{A CSS selector for scoping the spinner customization.
|
|
Defaults to the root element.}
|
|
}
|
|
\description{
|
|
Include the result of this function in the app's UI to customize spinner
|
|
appearance.
|
|
}
|
|
\details{
|
|
To effectively disable spinners, set the \code{size} to "0px".
|
|
}
|
|
\examples{
|
|
\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
|
|
|
|
library(bslib)
|
|
|
|
ui <- page_fillable(
|
|
useBusyIndicators(),
|
|
spinnerOptions(color = "orange"),
|
|
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[=useBusyIndicators]{useBusyIndicators()}} \code{\link[=pulseOptions]{pulseOptions()}}
|
|
}
|