Icons are a common feature of modern UI design. This module provides helpers
for inserting SVG icons or making use of popular icon font character
collections. The Bulma .icon element class, which is applied to a wrapping
<span> element, provides default sizing and size modifiers to make it easy to
fit icons into the visual layout of your page.
Construct an icon from the Font Awesome 4 collection, with alt text for screen readers
{ name = "bicycle"
, altText = "Bicycle route to destination"
}
|> Ui.Icon.fontAwesome4
|> Ui.render
--> <span class="icon" role="img" aria-label="Bicycle route to destination">
-- <i class="fa fa-bicycle" aria-hidden="true"></i>
-- </span><span> > <i>Construct an icon from Google's Material Design collection, with alt text for screen readers
{ name = "directions_bike"
, altText = "Bicycle route to destination"
}
|> Ui.Icon.material
|> Ui.render
--> <span class="icon" role="img" aria-label="Bicycle route to destination">
-- <i class="material-icons" aria-hidden="true">directions_bike</i>
-- </span><span> > <i>Construct an icon from the Ionicons collection, with alt text for screen readers
{ name = "android-bicycle"
, altText = "Bicycle route to destination"
}
|> Ui.Icon.ionicons
|> Ui.render
--> <span class="icon" role="img" aria-label="Bicycle route to destination">
-- <i class="ion-android-bicycle" aria-hidden="true"></i>
-- </span>Construct an icon from the Open Iconic collection, with alt text for screen readers
{ name = "map-marker"
, altText = "Your current location"
}
|> Ui.Icon.openIconic
|> Ui.render
--> <span class="icon" role="img" aria-label="Your current location">
-- <i class="oi" data-glyph="map-marker" aria-hidden="true"></i>
-- </span>
Construct an icon from an SVG source, with alt text for screen readers
<span>><object>