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

How can I add icons to bs_accordion headings #89

Open
latlio opened this issue Sep 30, 2020 · 2 comments
Open

How can I add icons to bs_accordion headings #89

latlio opened this issue Sep 30, 2020 · 2 comments

Comments

@latlio
Copy link

latlio commented Sep 30, 2020

I'm not sure where in the pipeline

bs_accordion() %>%
   bs_append(title = "test")

I can add a shiny icon

@mikews81
Copy link

mikews81 commented Oct 26, 2020

Hi

You should be able to add an icon by simply adding it to the title within a paragraph

bs_accordion() %>% bs_append(title = p(icon(“minus”),"test"))

If I could make a suggestion though @ijlyttle - further to adding an icon though it would be nice to have reactive icons that change depending on whether box is open or closed i.e. a ‘+’ sign when closed and a ‘-‘ when open. Maybe something along the lines of?

bs_accordion() %>% bs_append(title = "test", open = icon("minus"), closed = icon("plus"))

@warnes
Copy link

warnes commented Jan 6, 2023

I've just created PR #113 which adds the necessary tags so that you can use CSS to add open/close icons to the bs_accordion headlings. This is illustrated, using plain "+" and "-" characters in the man page example, shown in the comments to #113.

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

3 participants