4

I am trying to understand how to display buttons in an jupyter notebook, but the documentation is a bis sparse on this item.

It is mentioned there is an argument 'icon'. But what does it mean? What values can be used? Is there some documentation hidden somewhere else?

Alex
  • 41,580
  • 88
  • 260
  • 469

2 Answers2

9

You can specify an icon from the Font Awesome 4.7 catalog, by prefacing with fa-.

https://fontawesome.com/v4.7.0/icons/

import ipywidgets as ipyw

ipyw.Button(
    description = 'Button',
    icon = 'fa-bullhorn',
)

enter image description here

ac24
  • 5,325
  • 1
  • 16
  • 31
0

Actually, the documentation indicates that icon is the FontAwesome names without the 'fa-' prefixname. see doc here:

button = widgets.Button(
    description='Click me',
    disabled=False,
    button_style='', # 'success', 'info', 'warning', 'danger' or ''
    tooltip='Click me',
    icon='check' # (FontAwesome names without the `fa-` prefix)
)
button

therefore, the following code will also work:

import ipywidgets as ipyw

ipyw.Button(
    description = 'Button',
    icon = 'bullhorn',
)
vtec
  • 1
  • 2