Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some font-awesome icons not working for ToggleButtons #2848

Closed
giswqs opened this issue Apr 8, 2020 · 5 comments
Closed

Some font-awesome icons not working for ToggleButtons #2848

giswqs opened this issue Apr 8, 2020 · 5 comments

Comments

@giswqs
Copy link
Contributor

giswqs commented Apr 8, 2020

I am trying to add some font-awesome icons (e.g., chart-line, chart-scatter, chart-bar) to ToggleButtons, but these charting icons could not show up on the ToggleButtons. Any help will be appreciated.

import ipywidgets as widgets
t = widgets.ToggleButtons(
    options=['', '', '', ''],
    disabled=False,
    button_style='primary', 
    tooltips=['Pointer', 'Open a file', 'bar chart', 'line chart'],
    icons=['mouse-pointer', 'folder-open', 'chart-bar', 'chart-line'],
    layout=widgets.Layout(width='auto', height='auto')
)
t.style.button_width='40px'
t

Here is what it looks like

@martinRenou
Copy link
Member

martinRenou commented Apr 8, 2020

As far as I know, the current front-end version (Jupyter Notebook but maybe not JupyterLab) are using font awesome 4.7 https://fontawesome.com/v4.7.0. So only those icons are available.

@martinRenou
Copy link
Member

I updated JupyterLab so that it uses latest font-awesome two months ago, but we should do the same for Jupyter Notebook.

@giswqs
Copy link
Contributor Author

giswqs commented Apr 8, 2020

@martinRenou Thanks a lot for your prompt response. I just tried it on JupyterLab, it did show up correctly. It would be nice to have it working on Jupyter notebook. I am trying to add a toolbar to the ipyleaflet-based geemap package.

@martinRenou
Copy link
Member

I agree it would be nice

@giswqs
Copy link
Contributor Author

giswqs commented Apr 8, 2020

BTW, would it be possible to arrange the ToggleButtons as two columns vertically? I can only make it either one row horizontally or one column vertically, but I am not sure how to arrange it into more columns. It would be too long vertically with more than 10 icons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants