bsplus icon indicating copy to clipboard operation
bsplus copied to clipboard

How can I add icons to bs_accordion headings

Open latlio opened this issue 5 years ago • 2 comments

I'm not sure where in the pipeline

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

I can add a shiny icon

latlio avatar Sep 30 '20 13:09 latlio

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"))

mikews81 avatar Oct 26 '20 08:10 mikews81

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.

warnes avatar Jan 06 '23 22:01 warnes