Place vector icons anywhere using an icon font.
This component is using the fantastic Font Awesome icon font, a project by Dave Gandy. Altogether Font Awesome provides more than 300 symbols and glyphs for web-related actions. Icon fonts are great, because they enable you to easily change color, size and more via CSS. They are scalable vector graphics, which means that they look great on high-resolution displays.
Usage
To apply this component, add any .uk-icon-*
class to an <i>
or <span>
element. Et voilà, you have a vector icon, which inherits size and color just like your text does.
Examples
- Uses the
.uk-icon-cog
class - Uses the
.uk-icon-user
class - Uses the
.uk-icon-home
class - An icon in a link
Markup
<!-- This is an icon -->
<i class="uk-icon-cog"></i>
<!-- This is an icon in a link -->
<a href=""><i class="uk-icon-cog"></i> ...</a>
More examples
Button group
This example shows a group of buttons from the Button component with icons inside each button.
Example
Button dropdown
This example shows a button which is split into a standard action to the left and a dropdown toggle on the right, using the Dropdown component.
Example
Blockquotes
This example shows a blockquote from the Base component with a large quote icon. It also uses the .uk-align-left
class from the Utility component.
Example
The <blockquote> element defines a long quotation which also creates a new block by inserting white space before and after the blockquote element.
Size modifiers
Add the .uk-icon-small
, .uk-icon-medium
or .uk-icon-large
class to an icon to make the it larger.
- This is the default size.
- This icon uses the
.uk-icon-small
class. - This icon uses the
.uk-icon-medium
class. - This icon uses the
.uk-icon-large
class.
Spin modifier
Add the .uk-icon-spin
class to create animated spinning icons.
- Spinner icon for loading content …
- Refresh icon for refreshing content …
Icon button
Use the modifier .uk-icon-button
class to create an icon button, which can be used perfectly for social icons.
Example
Markup
<a href="" class="uk-icon-button uk-icon-github"></a>
Icon mapping
Here is an overview of all available .uk-icon-*
classes provided by Font Awesome.