Files
shiny/man/icon.Rd
Richard Iannone d65ad5ea90 Modify icon() function to call fontawesome::fa_i() for equivalent functionality (#3302)
* Use `fontawesome::fa_i()` for FA <i> tags

* Remove fontawesome vendor files

* Add fontawesome pkg to Imports & Remotes

* Remove FontAwesome `person()` entry

* Remove Font Awesome license info

* Delete font-awesome.R

* Update 'Collate' field (removes 'font-awesome.R')

* Delete updateFontAwesome.R

* Prefer use of `fontawesome::fa()`

* Improve function documentation

* Update help file using roxygen

* Modify icon name

* Update icon name in example

* Modify icon name in example

* Update help files

* Update bootstrap.R

* Update icon.Rd

* Update bootstrap.R

* Revert `showcaseCodeTabs()` to use FA v4 name

* Revert icon name in example (back to FA v4)

* Remove `call. = FALSE` in `stop()`

* Remove `fontawesome` from Remotes

* Add min version req for the fontawesome pkg

* Increase minimum version requirement for fontawesome

* Update roxygen docs for `icon()`

* Document (GitHub Actions)

* Update icon.Rd

* Generate early return <i> tag for tabsetPanel logic

* Close #3384 and #3383: simplify and correct icon() logic

* Install htmltools PR for now

* Document (GitHub Actions)

* Avoid using tag attribs to hold non-attribute values

* Better legacy support

* No need to call prepTabIcon() twice

* code review

* Fix glyphicon class creation

* update news

Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
Co-authored-by: rich-iannone <rich-iannone@users.noreply.github.com>
Co-authored-by: cpsievert <cpsievert@users.noreply.github.com>
2021-05-12 14:26:09 -05:00

47 lines
1.7 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bootstrap.R
\name{icon}
\alias{icon}
\title{Create an icon}
\usage{
icon(name, class = NULL, lib = "font-awesome", ...)
}
\arguments{
\item{name}{The name of the icon. A name from either \href{https://fontawesome.com/}{Font Awesome} (when \code{lib="font-awesome"}) or
\href{https://getbootstrap.com/docs/3.3/components/#glyphicons}{Bootstrap Glyphicons} (when
\code{lib="glyphicon"}) may be provided. Note that the \code{"fa-"} and
\code{"glyphicon-"} prefixes should not appear in name (i.e., the
\code{"fa-calendar"} icon should be referred to as \code{"calendar"}). A \code{name} of
\code{NULL} may also be provided to get a raw \verb{<i>} tag with no library attached
to it.}
\item{class}{Additional classes to customize the style of an icon (see the
\href{https://fontawesome.com/how-to-use}{usage examples} for details on
supported styles).}
\item{lib}{The icon library to use. Either \code{"font-awesome"} or \code{"glyphicon"}.}
\item{...}{Arguments passed to the \verb{<i>} tag of \link[htmltools:builder]{htmltools::tags}.}
}
\value{
An \verb{<i>} (icon) HTML tag.
}
\description{
Create an icon for use within a page. Icons can appear on their own, inside
of a button, and/or used with \code{\link[=tabPanel]{tabPanel()}} and \code{\link[=navbarMenu]{navbarMenu()}}.
}
\examples{
# add an icon to a submit button
submitButton("Update View", icon = icon("redo"))
navbarPage("App Title",
tabPanel("Plot", icon = icon("bar-chart-o")),
tabPanel("Summary", icon = icon("list-alt")),
tabPanel("Table", icon = icon("table"))
)
}
\seealso{
For lists of available icons, see \url{https://fontawesome.com/icons}
and \url{https://getbootstrap.com/docs/3.3/components/#glyphicons}
}