Learn R Programming

dqshiny (version 0.0.3)

dq_icon: Creates an icon element

Description

Creates a html icon element with the specified icon name from the given library.

Usage

dq_icon(icon, lib = "font-awesome", color = "#ff8f00",
  bg_color = NULL, size = NULL, ...)

Arguments

icon

name of the icon to show

lib

library used, needed to append the proper dependency

color

icon color, can be any valid CSS color code

bg_color

icon background color, can be any valid CSS color code

size

character specifying the size of the icon, can be one of "xs", "sm", "lg", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x"

...

additional attributes like style or class

Value

icon html element

Examples

Run this code
# NOT RUN {
## Only run examples in interactive R sessions
if (interactive()) {

library(shiny)
addResourcePath("images", system.file("www", "img", package = "dqshiny"))
shinyApp(
  ui = fluidPage(
    dq_icon("table", size = "4x"),
    dq_icon("check", color = "red", lib = "glyphicon", size = "2x"),
    dq_icon("phone", bg_color = "green", size = "lg"),
    dq_icon("images/logo_daqana.svg", size = "3x")
  ),
  server = function(input, output, session) {}
)

}
# }

Run the code above in your browser using DataLab