Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with {gt} #76

Open
mitchelloharawild opened this issue Aug 16, 2023 · 0 comments
Open

Compatibility with {gt} #76

mitchelloharawild opened this issue Aug 16, 2023 · 0 comments

Comments

@mitchelloharawild
Copy link
Owner

Lists of icons can be used with {gt} if their svg value is obtained via format, then handled as html via gt::fmt_markdown().

library(icons)
#> -- Installed icons ----------------------------------------------- icon 0.2.0 --
#> v ionicons        5.2.3       v google_material 4.0.0  
#> v health_icons    0.1.0       v feather_icons   v4.28.0
#> v academicons     1.9.1       v octicons        11.2.0 
#> v simple_icons    4.4.0       v fontawesome     5.15.2 
#> v bioicons        1.0.0
library(gt)
rockets <- icon_find("rocket")
tibble::tibble(
  name = names(rockets),
  icon = lapply(rockets, format)
) |> 
  gt::gt() |> 
  fmt_markdown("icon")

image

Created on 2023-08-17 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant