rheroicon: An inline SVG icon from Heroicons

Description Usage Arguments Value Styling Icons with 'CSS' class names References Examples

View source: R/rheroicon.R

Description

Render an icon by name. Run 'launch_gallery' to view all available icons or search for icons using the 'find_icons' function.

Usage

1
rheroicon(name, type = "outline", class = NULL)

Arguments

name

an icon name

type

render a 'solid' or 'outline' icon (default: 'outline')

class

a string containing one or more 'CSS' classes (optional)

Value

An string containing the 'SVG' markup of an icon

Styling Icons with 'CSS' class names

Icons are rendered from 'SVG' strings. All icons have three 'CSS' classes defined: global, icon style, and icon name.

global

All icons are returned with the 'CSS' class 'rheroicons'

icon style

All icons have a solid and an outlined version. The icon style 'CSS' class is determined by the value entered for 'type'. Icons can have 'rheroicons_outline' of 'rheroicons_solid'.

icon name

The icon name is also passed into the list of 'CSS' class. These are always structured in the following format: 'rheroicons_icon'. If the icon is 'thumb_down', the 'CSS' class would be 'rheroicons_thumb_down'.

Use any of combination of these classes to style icons via 'CSS'. In addition, you apply your own 'CSS' classes using the 'class' argument.

References

https://heroicons.com https://github.com/tailwindlabs/heroicons

Examples

1
2
3
rheroicon(name = "academic_cap")
rheroicon(name = "academic_cap", type = "solid")
rheroicon(name = "academic_cap", class = "education-icons")

rheroicons documentation built on April 7, 2021, 1:06 a.m.