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
FontAwesomeLabel - Vaadin Add-on Directory
Add the latest FontAwesome icons to your applications with modifiers like stack, spin, and flip.Discussion Forum
FontAwesome Website
FontAwesomeLabel version 1.0.0
Initial Version
FontAwesomeLabel version 1.1.0
- Fixed issue where setSize() affected only one element when stacking icons. The method now changes the size of both icons.
FontAwesomeLabel version 1.1.1
- Removed servlet from addon
FontAwesomeLabel version 1.1.2
- Upgrade to FontAwesome 4.2.0
FontAwesomeLabel version 1.1.4
- Required stylesheet will be automatically added to addons.scss by using the Vaadin-Stylesheets manifest attribute
- Created a font name specific to this addon (FontAwesomeLabelAddon) to clearly differentiate between the packaged Font Awesome font and the font provided by this addon.
FontAwesomeLabel version 1.1.5
- Bug fixes for setSize6x() and reverseStackSize()
FontAwesomeLabel version 1.1.6
- Bug fix for reverseStackSize()
FontAwesomeLabel version 1.1.7
- Fixes to stack sizing
- Added "text-align: center;" to .FontAwesomeLabelAddon style to match the native .FontAwesome style
FontAwesomeLabel version 1.1.8
Upgrade to Font Awesome 4.3.0
FontAwesomeLabel version 1.1.9
Added "@mixin font-awesome" declaration to font-awesome.scss to
resolve issue #2 (GitHub)
FontAwesomeLabel version 1.2.0
- Bug fix for improper closure of `` tag.
FontAwesomeLabel version 1.3.0
- Upgrade to FontAwesome 4.5.0 (A big thanks to pk1057 on GitHub for the contribution!)
FontAwesomeLabel version 1.3.1
- Fix icon alignment in button widgets
FontAwesomeLabel version 1.3.2
- Upgrade to Font Awesome 4.6.0
FontAwesomeLabel version 1.3.3
- Upgrade to Font Awesome 4.6.3
- FA500PX is now _500PX to match Vaadin's implementation. This is the last time it will change, I promise!
FontAwesomeLabel version 1.3.4
- Upgrade to FontAwesome 4.7.0
FontAwesomeLabel version 1.4.0
- Upgrade to Vaadin 8