shiny_fontawesome_icons.png

display_shiny_icons <- function() {
  df <- data.frame(
    stringsAsFactors = FALSE,
    icon_name = fontawesome::fa_metadata()$icon_names,
    icon = 42 # just a dummy numeric which is needed by reactablefmtr::icon_sets
  )

  n_row <- nrow(df)
  n_colors <- 256
  n_repeat <- ceiling(n_row/n_colors)
  colors <- viridisLite::viridis(n_colors)
  colors <- rep(colors, n_repeat)
  colors <- utils::head(colors, n_row)
  
  # https://kcuilla.github.io/reactablefmtr/
  cell <- reactablefmtr::icon_sets(
    data = df,
    colors = colors,
    icons = df$icon_name,
    icon_size = 30,
    icon_position = "over"
  )
  
  reactable::reactable(
    data = df,
    filterable = TRUE,
    defaultColDef = reactable::colDef(cell = cell)
  )
}

 

Make a promise. Show up. Do the work. Repeat.