fa {fontawesome} | R Documentation |
Generate Font Awesome icons as SVGs
Description
Add one or more Font Awesome icons as SVGs contained within <svg>...</svg>
.
We can optionally set certain style attributes. The fa()
function can be
used directly within inline evaluations of R code in R Markdown documents.
Usage
fa(
name,
fill = NULL,
fill_opacity = NULL,
stroke = NULL,
stroke_width = NULL,
stroke_opacity = NULL,
height = NULL,
width = NULL,
margin_left = NULL,
margin_right = NULL,
vertical_align = NULL,
position = NULL,
title = NULL,
prefer_type = c("regular", "solid"),
a11y = c("deco", "sem", "none")
)
Arguments
name |
The name of the Font Awesome icon. This could be as a short name
(e.g., |
fill , fill_opacity |
The fill color of the icon can be set with |
stroke , stroke_width , stroke_opacity |
The stroke options allow for
setting the color, width, and opacity of the SVG outline stroke. By
default, the stroke width is very small at |
height , width |
The height and width style attributes of the rendered
SVG. If nothing is provided for |
margin_left , margin_right |
The length value for the margin that's either
left or right of the icon. By default, |
vertical_align |
The vertical alignment of the icon. By default, a
length of |
position |
The value for the |
title |
An option for populating the SVG |
prefer_type |
Chooses the type of icon returned if: (1) providing a
short name, and (2) that icon has both solid and regular types.
For example, using |
a11y |
Cases that distinguish the role of the icon and inform which
accessibility attributes to be used. Icons can either be |
Value
A fontawesome
object.
Examples
if (interactive()) {
# Create a Font Awesome SVG icon
fa(name = "r-project")
}