Factory function that creates a waiter::Waiter instance pre-configured with Artalytics styling. Use this instead of creating Waiter objects directly to ensure consistent loading screens across modules.
Arguments
- html
Shiny tag. Loading screen HTML content. If
NULL(default), useswait_art_html()$htmlfor themed artwork loading animation.- fadeout
Logical or numeric. If
TRUE, fades out on hide. If numeric, specifies fade duration in milliseconds. Default:FALSE.- color
Character. Background color hex code. Default:
"#f8efe7"(cream).
Value
A waiter::Waiter object ready for use with $show() and $hide().
Details
This factory standardizes waiter creation across the platform. Common patterns:
Configure once, show/hide:
w <- create_waiter(fadeout = TRUE)
w$show()
# ... do work ...
w$hide()Update with different messages:
w <- create_waiter(fadeout = TRUE)
w$show()
w$update(html = wait_art_html(msg = "Step 1...")$html)
w$update(html = wait_art_html(msg = "Step 2...")$html)
w$hide()See also
wait_art_html() for generating themed HTML content
Other ui-components:
button_factory(),
stats-box,
status_badge(),
status_class(),
ui-helpers,
waiter-reexports,
waiter-screens
Examples
if (FALSE) { # \dontrun{
# Basic usage with defaults
w <- create_waiter(fadeout = TRUE)
w$show()
Sys.sleep(2)
w$hide()
# With custom message
w <- create_waiter(
html = wait_art_html(msg = "Processing artwork...")$html,
fadeout = TRUE
)
} # }
