Reputation: 269
I'm new to R, I saw that it's possible to animate some icons in dashboard on that webpage :
http://fontawesome.io/examples/#animated
But I don't understand where I have to write the indicated CSS code.
Please, could you tell me ?
Thank you very much.
Upvotes: 2
Views: 2341
Reputation: 5157
You can simply use the icon
function by adding a fa-spin
class. It should work with all icons, but spinner icons have the best visual.
icon("refresh", class = "fa-spin")
# <i class="fa fa-refresh fa-spin"></i>
icon("spinner", class = "fa-spin")
# <i class="fa fa-spinner fa-spin"></i>
Upvotes: 2
Reputation: 19544
You can simply use renderUI
together with htmltools::HTML
and uiOutput
to embed your HTML code directly in your shiny
app:
require("shinydashboard")
shinyApp(
ui = dashboardPage(
dashboardHeader(title = "Dashboard Demo"),
dashboardSidebar(),
dashboardBody(uiOutput("icon"))
),
server = function(input, output) {
output$icon <- renderUI(
htmltools::HTML('<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i><span class="sr-only">Loading...</span>')
)
}
)
Upvotes: 2