ph {phosphoricons}R Documentation

Phosphor SVG Icons

Description

Create a ⁠<svg></svg>⁠ tag to render an icon.

Usage

ph(
  name,
  weight = c("light", "regular", "thin", "bold", "fill"),
  fill = "currentColor",
  rotate = NULL,
  height = "1.33em",
  width = NULL,
  vertical_align = "-0.25em",
  title = name,
  ...
)

Arguments

name

Name of the icon to use.

weight

Weight of icon (from thinnest to thickest): thin, light (default), regular, bold or fill.

fill

Fill color for the icon, default is currentColor which should match the color of the text where the icon is used.

rotate

Numeric, angle to rotate the icon.

height, width

Height and width in valid CSS unit.

vertical_align

Vertical alignment for the icon, this depend on the size of the icon.

title

Add a ⁠<title>⁠ tag to provides an accessible, short-text description of the icon. Use NULL for no title.

...

Attributes passed to the SVG tag.

Value

An SVG tag.

Examples

library(phosphoricons)

ph("airplane-tilt")
ph("airplane-tilt", weight = "thin")
ph("airplane-tilt", weight = "bold")
ph("house")
ph("house", fill = "#F45B69")
ph("cake", rotate = 45)
ph("airplane-tilt", height = 128)
ph("airplane-tilt", height = 128, weight = "fill")
ph("airplane-tilt", height = 128, weight = "fill", fill = "steelblue")

[Package phosphoricons version 0.2.1 Index]