Create the correct Font Awesome class.

fa_icon(name, solid = TRUE, as_html = FALSE)

Arguments

name

Name of the Font Awesome icon

solid

Should the solid or the regular icon be used?

as_html

If FALSE (default), only the icon class is returned.

References

https://fontawesome.com/icons

Examples

fa_icon("github")
#> [1] "fab fa-github"
fa_icon("star")
#> [1] "fas fa-star"
fa_icon("star", FALSE)
#> [1] "far fa-star"