R/icon_text.R

Defines functions icon_text

Documented in icon_text

#' Icon Text
#'
#' Creates an HTML div containing the icon and text.
#'
#' @param icon fontawesome icon
#' @param text text
#'
#' @return HTML div
#' @export
#'
#' @examples
#' icon_text("table", "Table")
#'
#' @importFrom shiny icon tagList
#' @importFrom htmltools div
icon_text <- function(icon, text) {

  i <- shiny::icon(icon)
  t <- paste0(" ", text)

  shiny::tagList(htmltools::div(i, t))

}
jimbrig/myicons documentation built on June 12, 2020, 12:03 a.m.