Skip to contents

Create a Phosphor icon with font files.

Usage

ph_i(
  name,
  weight = c("light", "regular", "thin", "bold", "fill"),
  size = c("lg", "xxs", "xs", "sm", "xl", "1x", "2x", "3x", "4x", "5x", "6x", "7x",
    "8x", "9x", "10x"),
  color = NULL,
  ...
)

Arguments

name

Name of the icon to use.

weight

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

size

Size of icon.

color

Color of icon: use valid HTML color or hex code.

...

Attributes passed to the i tag.

Value

An HTML tag.

Examples

library(phosphoricons)

ph_i("airplane-tilt")
#> <i class="ph-airplane-tilt-light ph-lg"></i>
ph_i("airplane-tilt", weight = "thin")
#> <i class="ph-airplane-tilt-thin ph-lg"></i>
ph_i("airplane-tilt", weight = "bold")
#> <i class="ph-airplane-tilt-bold ph-lg"></i>
ph_i("house")
#> <i class="ph-house-light ph-lg"></i>
ph_i("house", color = "#F45B69")
#> <i class="ph-house-light ph-lg" style="color:#F45B69;"></i>
ph_i("cake")
#> <i class="ph-cake-light ph-lg"></i>
ph_i("cake", size = "xl")
#> <i class="ph-cake-light ph-xl"></i>
ph_i("cake", size = "10x")
#> <i class="ph-cake-light ph-10x"></i>