Adding icons to your UI

As we go through the various UI elements later, we're going to sprinkle a few icons throughout, just to give the page a bit more visual interest. Icons can come from two icon libraries, located at fontawesome.io/icons/ and getbootstrap.com/components/#glyphicons. They can be added simply using the icon() command with the name of the required icon given as a string.

For example, icon("user") will by default return icons from the fontawesome library, and to use the glyphicons, simply add lib = "glyphicon" as follows:

icon = icon("user", lib = "glyphicon")

They can be added directly to your UI or on buttons (including the buttons at the top of tab panels). From the full code of this application, you can see that we have replaced ...

Get Web Application Development with R Using Shiny - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.