All Projects β†’ rstudio β†’ Fontawesome

rstudio / Fontawesome

Licence: other
Easily insert FontAwesome icons into R Markdown docs and Shiny apps

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Fontawesome

Alfred Font Awesome Workflow
🎩 Font Awesome workflow for Alfred
Stars: ✭ 714 (+346.25%)
Mutual labels:  svg-icons, font-awesome
Svgtofont
Read a set of SVG icons and ouput a TTF/EOT/WOFF/WOFF2/SVG font.
Stars: ✭ 149 (-6.87%)
Mutual labels:  svg-icons
Bulma Social
🀳 Social Buttons and Colors for Bulma
Stars: ✭ 114 (-28.75%)
Mutual labels:  font-awesome
Styled Icons
πŸ’… Popular icon packs like Font Awesome, Material Design, and Octicons, available as React Styled Components
Stars: ✭ 1,878 (+1073.75%)
Mutual labels:  font-awesome
Font Awesome Scss
Font Awesome Scss Core (Unofficial)
Stars: ✭ 119 (-25.62%)
Mutual labels:  font-awesome
Coreui Icons
CoreUI Free Icons - Premium designed free icon set with marks in SVG, Webfont and raster formats
Stars: ✭ 1,813 (+1033.13%)
Mutual labels:  svg-icons
Svg Icon
πŸ‘» A lightweight library that makes it easier to use SVG icons in your Angular Application
Stars: ✭ 112 (-30%)
Mutual labels:  svg-icons
Webfonts Loader
Make an icon font from SVGs!
Stars: ✭ 153 (-4.37%)
Mutual labels:  svg-icons
Imguifontstudio
Font Helper Gui Tool for programming
Stars: ✭ 149 (-6.87%)
Mutual labels:  font-awesome
Svg To Ts
Build performant SVG icon libraries by converting raw SVG files to TypeScript that is optimized for modern tree shaking mechanisms.
Stars: ✭ 131 (-18.12%)
Mutual labels:  svg-icons
Minelab
GitLab inspired Sass theme for Redmine 2.5.x using Font Awesome, with support for Redmine CRM plugins.
Stars: ✭ 129 (-19.37%)
Mutual labels:  font-awesome
Simple Icons
SVG icons for popular brands
Stars: ✭ 12,090 (+7456.25%)
Mutual labels:  svg-icons
Vivid
a JavaScript library which is built to easily customize and use the SVG Icons with a blaze.
Stars: ✭ 1,797 (+1023.13%)
Mutual labels:  svg-icons
Tabler Icons
A set of over 1400 free MIT-licensed high-quality SVG icons for you to use in your web projects.
Stars: ✭ 10,858 (+6686.25%)
Mutual labels:  svg-icons
Angular Svg Icon
Angular component for inlining SVGs allowing them to be easily styled with CSS.
Stars: ✭ 151 (-5.62%)
Mutual labels:  svg-icons
Fontawesome.swift
Use FontAwesome in your Swift projects
Stars: ✭ 1,513 (+845.63%)
Mutual labels:  font-awesome
Svgiconimagelist
Three engines to render SVG (GDI+, Direct2D or Cairo) and four components to simplify use of SVG images (resize, fixedcolor, grayscale...): TSVGIconImage, TSVGIconImageCollection, TSVGIconVirtualImageList and TSVGIconImageList (for VCL and FMX).
Stars: ✭ 127 (-20.62%)
Mutual labels:  svg-icons
Circle Flags
A collection of 300+ minimal circular SVG country flags
Stars: ✭ 139 (-13.12%)
Mutual labels:  svg-icons
Glyphfriend
Glyphfriend is a Visual Studio Extension to add previews for various icon/glyph fonts to Visual Studio.
Stars: ✭ 157 (-1.87%)
Mutual labels:  font-awesome
Cryptocurrency Icons
A set of icons for all the main cryptocurrencies and altcoins, in a range of styles and sizes.
Stars: ✭ 2,116 (+1222.5%)
Mutual labels:  svg-icons


CRAN status R build status Package Site Coverage status

Contributor Covenant


The fontawesome R package makes it very easy to insert Font Awesome icons into R Markdown documents and Shiny apps (or, anywhere else you need to put them).

Examples

The fa() function can be used to insert an FA icon. For example, we can get the r-project icon in steelblue:

fa(name = "r-project", fill = "steelblue")
#> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 581 512" class="rfa" style="height:0.75em;fill:steelblue;position:relative;"><path d="M581 226.6C581 119.1 450.9 32 290.5 32S0 119.1 0 226.6C0 322.4 103.3 402 239.4 418.1V480h99.1v-61.5c24.3-2.7 47.6-7.4 69.4-13.9L448 480h112l-67.4-113.7c54.5-35.4 88.4-84.9 88.4-139.7zm-466.8 14.5c0-73.5 98.9-133 220.8-133s211.9 40.7 211.9 133c0 50.1-26.5 85-70.3 106.4-2.4-1.6-4.7-2.9-6.4-3.7-10.2-5.2-27.8-10.5-27.8-10.5s86.6-6.4 86.6-92.7-90.6-87.9-90.6-87.9h-199V361c-74.1-21.5-125.2-67.1-125.2-119.9zm225.1 38.3v-55.6c57.8 0 87.8-6.8 87.8 27.3 0 36.5-38.2 28.3-87.8 28.3zm-.9 72.5H365c10.8 0 18.9 11.7 24 19.2-16.1 1.9-33 2.8-50.6 2.9v-22.1z"/></svg>

As can be seen, what we really get from the function is an SVG object that represents the icon. This can be directly used within R Markdown with:

{text} `r fa(...)` {text}

Font Awesome SVG icons are great to use instead of <i> tags + font files for a few reasons:

  • There is less overhead in a Shiny app or R Markdown document since an <i> tag requires computation to obtain the icon (<svg> tags represent the actual icon)
  • Using <i> tags has a 'being online' requirement since network activity is necessary for resolving these tags (SVGs in fontawesome are stored in the package, so, no Internet connectivity is necessary for that)
  • There are styling options available for SVG that aren't there for icon fonts

R Markdown

Here is an example R Markdown document that includes Font Awesome icons:

---
title: "Font Awesome in R Markdown"
output: html_document
---

```{r load_packages, message=FALSE, warning=FALSE, include=FALSE} 
library(fontawesome)
```

# Just a few tests with `r fa("font-awesome-logo-full", fill = "forestgreen")`

It works well in headings...

# `r fa("r-project", fill = "steelblue")` H1 Heading

## `r fa("r-project", fill = "steelblue")` H2 Heading

### `r fa("r-project", fill = "steelblue")` H3 Heading

#### `r fa("r-project", fill = "steelblue")` H4 Heading

##### `r fa("r-project", fill = "steelblue")` H5 Heading

...and works equally well within inline text: `r fa("r-project", fill = "steelblue")`.

This will appear, when knit, as:

Shiny

Here’s a Shiny app (from the Shiny Gallery) that’s been slightly modified to incorporate Font Awesome icons in the text above the three search fields:

library(shiny)
library(DT)
library(ggplot2)
library(fontawesome)

ui <- fluidPage(

  titlePanel("Basic DataTable"),

  # Create a new Row in the UI for selectInputs
  fluidRow(

    column(
      width = 4,
      selectInput(
        inputId = "man",
        label = tags$p(fa("car", fill = "purple"), "Manufacturer:"),
        choices = c(
          "All",
          unique(as.character(mpg$manufacturer))))
    ),

    column(
      width = 4,
      selectInput(
        inputId = "trans",
        label = tags$p(fa("car", fill = "forestgreen"), "Transmission:"),
        choices = c(
          "All",
          unique(as.character(mpg$trans))))
    ),

    column(
      width = 4,
      selectInput(
        inputId = "cyl",
        label = tags$p(fa("car", fill = "steelblue"), "Cylinders:"),
        choices = c(
          "All",
          unique(as.character(mpg$cyl))))
    )
  ),

  # Create a new row for the table.
  fluidRow(
    dataTableOutput("table")
  )
)

server <- function(input, output) {

  # Filter data based on selections
  output$table <- renderDataTable({

    data <- mpg
    if (input$man != "All") {
      data <- data[data$manufacturer == input$man,]
    }
    if (input$cyl != "All") {
      data <- data[data$cyl == input$cyl,]
    }
    if (input$trans != "All") {
      data <- data[data$trans == input$trans,]
    }
    data
  })
}

shinyApp(ui = ui, server = server)

The Shiny app will look something like this:

Please note that using shiny::icon() in place of fontawesome::fa() will still work. Internally, the icon() function will call fontawesome's fa_i() function, which generates an old-school <i> tag for the icon.

Installation

Want to try this out? The fontawesome package can be installed from CRAN:

install.packages("fontawesome")

Also, you can install the development version of fontawesome from GitHub:

devtools::install_github("rstudio/fontawesome")

If you encounter a bug, have usage questions, or want to share ideas to make this package better, feel free to file an issue.

Code of Conduct

Please note that the rstudio/fontawesome project is released with a contributor code of conduct.
By participating in this project you agree to abide by its terms.

πŸ›οΈ Governance

This project is primarily maintained by Rich Iannone. Other authors may occasionally assist with some of these duties.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].