Shiny app-show some message while user is waiting for output

Hi everyone, is it possible to allow shiny to show some messages while user are waiting for the result of the computation? For example, for a function that would take a long time, a user would see this, which is something gray. However, I want to user to know more about what is going on, such as showing "Computing XXX", like what we would see on a well designed web app. I know an error or a warning would be shown on the screen, but is there any other way besides them?
It would be even better if some loading anime can be shown.

The following displays a spinning orange cog when shiny tells the browser that it is busy. Feel free to customize it as needed and replace fa fa-spinner fa-pulse fa-fw with any other font awesome animation

shiny_busy <- function() {
  # use &nbsp; for some alignment, if needed
  HTML("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", paste0(
    '<span data-display-if="',
    '<i class="fa fa-spinner fa-pulse fa-fw" style="color:orange"></i>',

# call from shiny ui with

Thank you Mike! I am not very familiar with CSS but is there a way to adjust the size of the spinner?

Change style to something like style="color:orange; font-size:30px"

@trcc , I can't tell for sure, but also look into to remove the temporary state of 'argument is not a matrix'.