---
title: Icon
fontawesome4: true
iconic: true
ionicons: true
mdi: true
layout: documentation
doc-tab: elements
doc-subtab: icon
breadcrumb:
- home
- documentation
- elements
- elements-icon
meta:
colors: true
sizes: true
variables: true
---
{% capture icon_example %}
{% endcapture %}
{% capture icon_color_example %}
{% endcapture %}
{% capture icon_sizes_example %}
{% endcapture %}
{% capture stacked_medium %}
{% endcapture %}
{% capture stacked_large %}
{% endcapture %}
The icon
element is a container for any type of icon font. Because the icons can take a few seconds to load, and because you want control over the space the icons will take, you can use the icon
class as a reliable square container that will prevent the page to "jump" on page load.
By default, the icon
container will take up exactly 1.5rem x 1.5rem
. The icon itself is sized accordingly to the icon library you're using. For example, Font Awesome 5 icons will inherit the font size.
{% include anchor.html name="Colors" %}
Since icon fonts are simply text, you can use the text color modifiers to change the icon's color.
{% include snippet.html content=icon_color_example %}
{% include anchor.html name="Sizes" %}
The Bulma icon
container comes in 4 sizes. It should always be slightly bigger than the icon it contains. For example, Font Awesome 5 icons use a font-size of 1em
by default (since it inherits the font size), but provides additional sizes.
Font Awesome also provides modifier classes for:
-
fixed width icons
-
bordered icons
-
animated icons
-
rotated & flipped icons
-
stacked icons
Here is how the icon
container can be used with Material Design Icons.
MDI also provides modifier classes for:
-
light and dark icons
-
rotated & flipped icons
Here is how the icon
container can be used with Open Iconic.
Here is how the icon
container can be used with Ionicons.