lattyware/elm-fontawesome/2.3.0

NOTE: the latest version is 7.2.0

FontAwesome.Icon

Rendering icons for use in HTML.

Note the various view methods are all just convenience wrappers of viewWithId. It may make sense to create your own wrapper method with just the functionality you need if the given ones don't match your use case.

The "defaults" as called by view would be: viewWithId icon.name [] [] Nothing Nothing icon.

view : Icon -> Html msg

A convenience method for simply rendering the icon.

viewStyled : List (Attribute msg) -> Icon -> Html msg

A convenience method for simply rendering the icon with some additional styles.

If you want to add a class, make sure to use Svg.Attributes.class not Html.Attributes.class.

viewTransformed : List (Attribute msg) -> List Transform -> Icon -> Html msg

Render the icon with some transforms. Also takes additional attributes to be applied to the SVG node, should you wish to supply any.

If you want to add a class, make sure to use Svg.Attributes.class not Html.Attributes.class.

List (Attribute msg)
-> List Transform
-> Maybe Icon
-> Icon
-> Html msg

Render one icon as a mask over the other - this means that the inner icon (given second) is cut out of the outer icon. The big difference between this and layering is that the background can show through, as the cut out icon becomes a truly transparent area (not just the same color as the background).

Note this sets IDs in order to achieve masking. If you use the same inner icon more than once on a page, you should use viewWithId instead and pass a unique ID for each element to avoid repeated IDs.

If you want to add a class, make sure to use Svg.Attributes.class not Html.Attributes.class.

List (Attribute msg)
-> List Transform
-> Maybe String
-> Maybe Icon
-> Icon
-> Html msg

Render as in viewMasked, but with an optional title element in the SVG for accessibility.

If a title is provided, the element is considered a semantic icon, and aria-hidden will not be set. If a title is not provided then the element is assumed to be purely decorative, and aria-hidden is set.

Note this sets an ID for the aria-labelledby element. If you use the same inner icon titled more than once on a page, you should use viewWithId instead and pass a unique ID for each element to avoid repeated IDs.

If you want to add a class, make sure to use Svg.Attributes.class not Html.Attributes.class.

String
-> List (Attribute msg)
-> List Transform
-> Maybe String
-> Maybe Icon
-> Icon
-> Html msg

Render as in viewTitled, but with a provided unique ID. This allows you to avoid overlapping IDs if the same elements are repeated for correctness.

If you want to add a class, make sure to use Svg.Attributes.class not Html.Attributes.class.

type alias Icon =
{ prefix : String
, name : String
, width : Int
, height : Int
, path : String
}

The definition of an icon.