FontAwesomeLabel
Add the latest FontAwesome icons to your applications with modifiers like stack, spin, and flip.
Font Awesome Icons for Vaadin
Do you want the newer Font Awesome icons not currently packaged in Vaadin? This addon includes a replacement FontAwesome enum with the latest icons, and enhances their native functionality.
The enum works just like the existing implementation, so setIcon()
works as you would expect. Also included is a getLabel()
method, which returns a label component with all of the CSS classes that Font Awesome provides. This component allows you to add multiple modifiers to your icons in a one-liner fashion by chaining methods such as stack()
, spin()
, setSize2x()
, setBorder()
, etc.
This addon is currently packaged with FontAwesome 4.7.0. To use it add the JAR file to your classpath. It may be necessary to re-compile your theme. If you're having trouble using this addon, please see the Troubleshooting section of the readme in GitHub.
The code written for this addon (FontAwesome, FontAwesomeLabel and HTML scraper) is licensed under the Apache 2.0 license. Font Awesome is licensed under the MIT and SIL OFL 1.1 licenses. See fontawesome.io/license for more information.
Vaadin 7 users must use version 1.3.4. Vaadin 7 compatibility will no longer be maintained.
Sample code
import com.kbdunn.vaadin.addons.fontawesome.FontAwesome; // 3x Large Spinning Cog! content.addComponent(FontAwesome.COG.getLabel().setSize3x().spin()); // Stack icons content.addComponent(FontAwesome.TWITTER.getLabel().stack(FontAwesome.SQUARE_O).setSize3x()); // Stack icons with separate modifiers content.addComponent(FontAwesome.HDD_O.getLabel().stack(FontAwesome.EXCLAMATION.getLabel().inverseColor()).setSize3x().reverseStackSize()); // Set the icon of another Vaadin component button.setIcon(FontAwesome.SMILE_O);
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
- Upgrade to Vaadin 8
- Released
- 2017-05-25
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 8.0+
- Vaadin 7.1+ in 1.3.4
- Vaadin 7.0+ in 1.1.2
- Browser
- Browser Independent