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

Stacking fontawesome icons in the menuItem #110

Open
danwwilson opened this issue Dec 2, 2015 · 3 comments
Open

Stacking fontawesome icons in the menuItem #110

danwwilson opened this issue Dec 2, 2015 · 3 comments
Labels

Comments

@danwwilson
Copy link

danwwilson commented Dec 2, 2015

When attempting to stack icons in the menuItem I encounter the error "Error: Expected tag to be of type i"

Code used is: menuItem("test stack", tabName = "t_donorTrends", icon = span(class="fa-user fa-plus", icon("user", "fa-stack-1x"), icon("ban", "fa-stack-2x")))

I presume that this is because the icon = expects to see icon = icon(...) rather than a span(). Unfortunately if I ditch the icon = ... it doesn't apply an icon to my menuItem

Any thoughts how we can bring this useful feature to shinydashboard?

@dmpe
Copy link
Contributor

dmpe commented Dec 6, 2015

Hi @danwwilson ,
Sorry for late answer. I am trying to reproduce your example and yes i got that message too with this https://gist.github.com/dmpe/0e3bdf2ec802fd8aaabe.

library(devtools)
devtools::install_github("rstudio/shiny")
    menuItem(
      "test stack",
      icon = icon("fa fa-user-plus"),
      icon("user", "fa-stack-1x"),
      icon("ban", "fa-stack-2x")
    )

sh2i
shi

As they & you write the icon must be inside <i> tag thus span is will not work. But you can also try something like:

    menuItem(
      "test stack",
      icon = icon("fa fa-user-plus"),
      icon("user", "fa-stack-1x"),
      icon("ban", "fa-stack-2x"),
      span(shiny::icon("fa fa-user-plus"))
    )

to produce

sh3i. Does that help you ?

Source:

span(shiny::icon("bars"), style = "display:none;"),

dmpe added a commit to dmpe/shinydashboard that referenced this issue Dec 6, 2015
@danwwilson
Copy link
Author

My approach to stacking was to circumvent the missing icons from FontAwesome V4.2. However it would be great if it was possible to stack icons against the menuItem within shinydashboard

@dmpe
Copy link
Contributor

dmpe commented Dec 8, 2015

Could you maybe provide some example, please? Thank you!

dmpe added a commit to dmpe/shinydashboard that referenced this issue Jan 31, 2016
@wch wch added the backlog label Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants