icon_style: Customise the style of an icon

View source: R/style.R

icon_styleR Documentation

Customise the style of an icon

Description

Customise the style of an icon

Usage

icon_style(x, scale = NULL, fill = NULL, rotate = NULL, ...)

Arguments

x

The icon to style.

scale

Scaled size of the icon.

fill

The colour for the fill.

rotate

The angle to rotate the icon.

...

Other CSS rules for the icon style, for example float = "right".

Value

The input x (an icons vector), with its style updated to reflect the requested styling.

Examples

path <- tempfile(fileext = ".svg")
writeLines(
  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0"/></svg>',
  path
)
icon <- read_icon(path)
icon_style(icon, scale = 2, fill = "red", rotate = 90)


icons documentation built on Sept. 3, 2026, 5:10 p.m.