3

I have a "Next Page" actionButton within my shiny-app that has an arrow displayed as an icon and the words "Next Page". However, the icon always appears in front of the lable like this:

enter image description here

I want the icon to appear after the text, like it is normally done. I am using the code

hidden(actionButton(inputId = "Next", label = "Next Page", icon = icon("chevron-right"), width = "20%"))

Simply changing the order of the code does not work and I could not find any examples. I would appreciate any tipps, thank you!

Soph2010
  • 563
  • 3
  • 13

1 Answers1

6

You can use div ton construct the icon after text:

actionButton(inputId = "Next", label = div("Next Page", icon("chevron-right")), width = "20%")
Clemsang
  • 5,053
  • 3
  • 23
  • 41
  • I am using this method for a button with "caret-down". I would like to change it to "caret-up" once I have clicked on it. `updateActionButton(session, 'mybutton', label = div('Label', icon = 'caret-up'))` (simplifying here) but that's not working. Any idea why? – Adrarc Jul 01 '22 at 06:54
  • Please post a new question. Have a look at conditionnalPanel based on value of button – Clemsang Jul 01 '22 at 06:56