Here's how I use the function provided by github.com/AnalytixWare/ShinySky/blob/master/R/busy-indicator.r
In your UI:
tagList(
tags$head(
tags$script(type="text/javascript", src = "busy.js")
)
),
div(class = "busy", p('your text'),img(src="loader.gif")
)
where a folder www inlcudes the loader.gif and busy.js with
setInterval(function(){
if ($('html').attr('class')=='shiny-busy') {
setTimeout(function() {
if ($('html').attr('class')=='shiny-busy') {
$('div.busy').show()
}
}, 1500)
} else {
$('div.busy').hide()
}
}, 0)
The loader.gif (and the text if provided) then always appears when shiny is busy (with the delay provided in the function).