icon

icon(name, class = NULL, lib = "font-awesome")

Arguments

name Name of icon. Icons are drawn from the Font Awesome library. Note that the "fa-" prefix should not be used in icon names (i.e. the "fa-calendar" icon should be referred to as "calendar")
class Additional classes to customize the style of the icon (see the usage examples for details on supported styles).
lib Icon library to use ("font-awesome" is only one currently supported)

Create an icon

Value

An icon element

Description

Create an icon for use within a page. Icons can appear on their own, inside of a button, or as an icon for a tabPanel within a navbarPage.

Examples

icon("calendar") # standard icon
<i class="fa fa-calendar"></i>
icon("calendar", "fa-3x") # 3x normal size
<i class="fa fa-calendar fa-3x"></i>
# add an icon to a submit button submitButton("Update View", icon = icon("refresh"))
<div> <button type="submit" class="btn btn-primary"> <i class="fa fa-refresh"></i> Update View </button> </div>
shinyUI(navbarPage("App Title", tabPanel("Plot", icon = icon("bar-chart-o")), tabPanel("Summary", icon = icon("list-alt")), tabPanel("Table", icon = icon("table")) ))
<div class="navbar navbar-static-top"> <div class="navbar-inner"> <div class="container"> <span class="brand pull-left">App Title</span> <ul class="nav"> <li class="active"> <a href="#tab-4142-1" data-toggle="tab"> <i class=" fa fa-bar-chart-o fa-fw"></i> Plot </a> </li> <li> <a href="#tab-4142-2" data-toggle="tab"> <i class=" fa fa-list-alt fa-fw"></i> Summary </a> </li> <li> <a href="#tab-4142-3" data-toggle="tab"> <i class=" fa fa-table fa-fw"></i> Table </a> </li> </ul> </div> </div> </div> <div class="container-fluid"> <div class="row-fluid">&nbsp;</div> <div class="tab-content"> <div class="tab-pane active" data-icon-class="fa fa-bar-chart-o" id="tab-4142-1"></div> <div class="tab-pane" data-icon-class="fa fa-list-alt" id="tab-4142-2"></div> <div class="tab-pane" data-icon-class="fa fa-table" id="tab-4142-3"></div> </div> </div>