Orasund/elm-ui-widgets/3.3.0

NOTE: the latest version is 3.4.0

Widget.Icon

This module ensures that every icon package on package.elm-lang.org is supported.

Just look for the function with the name of the package and copy&paste the respective example.

type alias IconStyle =
{ size : Int
, color : Color
}
type alias Icon msg =
{ size : Int
, color : Color
}
-> Element msg
antDesignIconsElm : (List (Attribute msg) -> Html msg) -> Icon msg

For using lemol/ant-design-icons-elm

import Ant.Icons.Svg
import Widget.Icon exposing (Icon)


check : Widget.Icon
check =
    Ant.Icons.Svg.checkOutlined
        |> Widget.Icon.antDesignIconsElm
elmFeather : (List (Attribute msg) -> icon -> Html msg) -> icon -> Icon msg

For using feathericons/elm-feather

import FeatherIcons
import Widget.Icon exposing (Icon)


check : Widget.Icon
check =
    FeatherIcons.check
        |> Widget.Icon.elmFeather FeatherIcons.toHtml
elmFontawesome : (icon -> Svg msg) -> icon -> Icon msg

For using lattyware/elm-fontawesome

import FontAwesome.Icon
import FontAwesome.Solid
import FontAwesome.Svg
import Widget.Icon exposing (Icon)


check : Widget.Icon
check =
    FontAwesome.Solid.check
        |> Widget.Icon.elmFontawesome FontAwesome.Svg.viewIcon
elmHeroicons : (List (Attribute msg) -> Html msg) -> Icon msg

For using jasonliang-dev/elm-heroicons

import Heroicons.Solid
import Widget.Icon exposing (Icon)


check : Widget.Icon
check =
    Heroicons.Solid.check
        |> Widget.Icon.elmHeroicons
( Int
-> { red : Float
, green : Float
, blue : Float
, alpha : Float
}
-> Html msg
)
-> Icon msg

For using j-panasiuk/elm-ionicons

import Ionicon
import Widget.Icon exposing (Icon)


check : Widget.Icon
check =
    Ionicon.checkmark
        |> Widget.Icon.elmIonicons
elmMaterialIcons : (Color -> coloring) -> (Int -> coloring -> Html msg) -> Icon msg

For using icidasset/elm-material-icons

import Material.Icons exposing (offline_bolt)
import Material.Icons.Types exposing (Coloring(..))
import Widget.Icon exposing (Icon)


check : Widget.Icon
check =
    Material.Icons.done
        |> Widget.Icon.elmMaterialIcons Color
{ withSize : Int -> options -> options
, withColor : String -> options -> options
, defaultOptions : options
}
-> (options -> Html msg)
-> Icon msg

For using capitalist/elm-octicons

import Octicons
import Widget.Icon exposing (Icon)


check : Widget.Icon
check =
    Octicons.check
        |> Widget.Icon.elmOcticons
            { withSize = Octicons.size
            , withColor = Octicons.color
            , defaultOptions = Octicons.defaultOptions
            }
elmZondicons : (List (Attribute msg) -> Html msg) -> Icon msg

For using pehota/elm-zondicons

import Widget.Icon exposing (Icon)
import Zondicons


check : Widget.Icon
check =
    Zondicons.checkmark
        |> Widget.Icon.elmZondicons
materialIcons : (Color -> Int -> Svg msg) -> Icon msg

For using danmarcab/material-icons

import Material.Icons.Action
import Widget.Icon exposing (Icon)


check : Widget.Icon
check =
    Material.Icons.Action.done
        |> Widget.Icon.materialIcons