Package 'rheroicons'

Title: A Zero Dependency 'SVG' Icon Library for 'Shiny'
Description: An implementation of the 'Heroicons' icon library for 'shiny' applications and other 'R' web-based projects. You can search, render, and customize icons without 'CSS' or 'JavaScript' dependencies.
Authors: David Ruvolo [aut, cre] , Adam Wathan [ctb, cph] (Author of heroicons library), Steve Schoger [ctb, cph] (Author of heroicons library)
Maintainer: David Ruvolo <[email protected]>
License: MIT + file LICENSE
Version: 1.0.0
Built: 2024-12-12 06:59:02 UTC
Source: CRAN

Help Index


Find available icons

Description

You can search for icons by querying the icon set. For example, if you would like to find icons that are arrows and chevrons, then type in you query as a regexp: 'arrows|chevrons'. Alternatively, if you would like to view all icon names, leave the value for 'query' blank.

Usage

find_icons(query = ".")

Arguments

query

a string containing a search term

Value

An array of icon names

References

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

Examples

find_icons(query = "chevron")
find_icons(query = "chevron|arrow")
find_icons(query = "down|up|left|right")
find_icons(query = "-circle")
find_icons(query = "(-down)$")

An inline SVG icon from Heroicons

Description

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

Usage

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

Arguments

name

string containing the name of an icon

type

render icon by style; either 'solid', 'outline', or 'mini' (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', 'rheroicons-solid', or 'rheroicons-mini'.

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 'hand-thumb-down', the 'CSS' class would be 'rheroicons-hand-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

rheroicon(name = "face-smile")
rheroicon(name = "face-smile", type = "solid")
rheroicon(name = "face-smile", class = "my-icon-set")