google / mesop

Build delightful web apps quickly in Python
https://google.github.io/mesop/
Apache License 2.0
4.1k stars 190 forks source link

Provide support for SVG xml in icon #529

Open ghchinoy opened 1 week ago

ghchinoy commented 1 week ago

Is your feature request related to a problem? Please describe. It would be great to support custom svg xml as an input for the icon component

Describe the solution you'd like extend icon to allow in-lining (or file path input reference) for svg xml

https://material.angular.io/components/icon/overview#svg-icons

Describe alternatives you've considered Haven't tried any other way to add svg to mesop

wwwillchen commented 1 week ago

Thanks for filing an issue. Agree, it would be nice to eventually support this. For now, you should be able to use web components to inline SVGs: https://google.github.io/mesop/web_components/ - let me know if you run into troubles doing that.

ghchinoy commented 6 days ago

Works like a charm, thank you!

ghchinoy commented 2 days ago

As an update, I created a stand alone component for this https://github.com/ghchinoy/mesop-svg-icon