Find icons in installed sets by name

icon_find(name, set = NULL)

Arguments

name

The name of the icon

set

Icon sets to search. If NULL, all available icons will be searched.

Value

An icons vector of matching icons (empty if none are found). Use icon_label() to recover each match's library$sub$name accessor expression (for example "fontawesome$solid$rocket") - the result itself carries no names(), since an icons vector can't hold them.

Examples

# Empty if no installed icon set has a matching icon
icon_find("rocket")
#> <icons[0]>

if(icon_installed(fontawesome)){

found <- icon_find("rocket")
icon_label(found)

}