ijlyttle / bsplus

Shiny and R Markdown addons to Bootstrap 3
http://ijlyttle.github.io/bsplus/
Other
147 stars 23 forks source link

How can I add icons to bs_accordion headings #89

Open latlio opened 3 years ago

latlio commented 3 years ago

I'm not sure where in the pipeline

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

I can add a shiny icon

mikews81 commented 3 years ago

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 commented 1 year ago

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.