Title: | A Zero Dependency 'SVG' Icon Library for 'Shiny' |
Version: | 1.0.0 |
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. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.1 |
Imports: | htmltools (≥ 0.5.3), shiny (≥ 1.5.0), stringr |
Suggests: | spelling, testthat |
Depends: | R (≥ 2.10) |
Language: | en-US |
NeedsCompilation: | yes |
Packaged: | 2022-10-30 12:19:43 UTC; davidruvolo |
Author: | David Ruvolo |
Maintainer: | David Ruvolo <dcruvolo@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2022-10-30 12:35:01 UTC |
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)$")
Icon gallery
Description
Run the gallery to view and search for icons. Click on an icon name to copy the 'R' code to the clipboard.
Usage
launch_gallery(...)
Arguments
... |
additional 'shiny' options |
Value
A 'shiny' app containing the icon gallery
Examples
if (interactive()) {
rheroicons::launch_gallery()
}
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")