-
Notifications
You must be signed in to change notification settings - Fork 945
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
feature: support more than just font-awesome, svg icons, iconify #3850
Comments
Hi Talley, does iconify add a iconset, or does this allow adding of new icons on the fly? cheers, Maarte |
iconify itself is more like an api wrapper around many (100+) other icon sets (150,000+ total icons, searchable here). The icon sets are actively maintained, but i don't think it allows you to, add new icons on the fly per se (they would need to be in the API). It would require internet access (they are not pre-downloaded font files), which I can imagine not working for some ipywidgets applications. So probably not a total replacement. |
Note there is also ipyvuetify which bundles many icons https://ipyvuetify.readthedocs.io/en/latest/usage.html#icons |
If SVG icons were supported, maybe in future the built-in widgets could re-use the SVG assets which are shipped by Jupyter Notebook 7+/JupyterLab (and fallback to font awesome if not available). Currently not all icons that would be needed are provided by |
I'd love to see this - |
Problem
the built-in support for font-awesome is nice, but limited, and a bit out of date. SVGs are very flexible and there are tons of alternative libraries out there. notably, iconify provides access to a huge amount of them with a single unified API
It would be nice to be able to show SVG icons on buttons (or other places with icons).
Proposed Solution
There are likely many ways to do this, and I'm happy to implement them, but wanted to get your input first:
widget_button.ts
could be modified to see if a colon is inside theicon
name string, and if so, assume the iconify API is being used (this would require adding the iconify SVG framework js code somewhere)Button
widget could be relaxed to allow for a full svg element to be passed?Additional context
i created/maintain magicgui which is an abstraction layer that lets people create guis that go from Qt to ipywidgets easily. I'm adding a PR that adds icons to buttons (pyapp-kit/magicgui#598)... the qt side is very flexible thanks to iconify, but the ipywidgets side is restrictive.
The text was updated successfully, but these errors were encountered: