1

With R Shiny, adding an icon to an actionButton uses icon() function.

    actionButton(
       ...
      , icon = shiny::icon(icon_name)
    )

How can this be achieved with shiny.ui.input_action_button?

    ui.input_action_button(
        ...
        icon = ?
    )

Whatever I try in (?) seems to make it into a label instead of an icon.

M--
  • 25,431
  • 8
  • 61
  • 93
Vlad
  • 3,058
  • 4
  • 25
  • 53

2 Answers2

2

Only example I found used emoji directly like this

ui.input_action_button("go", "Go!", icon="")

Not sure you can use icon like R shiny.

Yousuf Ali
  • 48
  • 5
0

For the functions that accepts icon parameter, you can use an ui.img if you have an image like so:

icon=ui.img(src='image.png',
            height='18px',
            style='margin-bottom:2px'
            )

but you have to first make sure your www_dir is created which contains the image with the correct Path location and your App() function should have static_assets=www_dir

jesliu
  • 11
  • 1