R/feather_icons.R

Defines functions feather_icons

Documented in feather_icons

#' A Feather Icon div
#'
#' @param icon the icon
#' @param ... optional content to the div
#'
#' @importFrom htmltools tagList tags HTML
#' @importFrom attempt stop_if_not
#' @importFrom glue glue
#'
#' @return an HTML div
#' @export
#'
#' @examples
#' feather_icons("circle")

feather_icons <- function(icon){
  stop_if_not(icon, ~ .x %in% feathericons::icons_list, "This icon is not available")
  HTML(
      glue(
      "<div data-feather = '{icon}' ></div> "
      )
    )
}
ColinFay/feathericons documentation built on May 25, 2019, 4:25 p.m.