How do you include your own icons in Vaadin Flow? Do you make an HTML file like this one from Vaadin Icons and include it via
@HtmlImport("frontend://path/to/your/icons.html")
I did not find any documentation so far. So I guess this is one possibility?
Here is an example of adding some IcoMoon icons to a Vaadin Flow App;
Using the notes in https://icomoon.io/docs.html under the section 'Generating Icons in SVG & More', I generated the Polymer compatible icon set in iron-iconset-svg format.
Extract the zip file, and open the polymer folder. It contains the *-svg.html file which is the 'iron-iconset-svg' format file that @Jouni is talking about in the above note. This html file is actually a collection of inline SVGs.
Copy the html file to your resources folder;
e.g. resources/META-INF/resources/frontend/styles/
And import that using @HtmlImport
;
e.g. @HtmlImport("frontend://styles/icomoon-iconset-svg.html")
Then you can create icons using the collection name and the icon name;
Icon icon = new Icon("icomoon", "mobile");
<iron-iconset-svg name=...
in the html file.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With