ohanhi / elm-native-ui

[CLOSED] Experiment: mobile apps in Elm using React Native.
BSD 3-Clause "New" or "Revised" License
1.54k stars 76 forks source link

Add ability to specify Image source with uri and cache #76

Closed jaischeema closed 7 years ago

jaischeema commented 7 years ago

This will let you use images from local bundled assets, very simple first version, can be extended as per requirements.

Example usage:

import NativeUi.Elements as Elements exposing (..)
import NativeUi.Image as Image

imageTag : String -> Node msg
imageTag assetName =
    Elements.image
        [ Ui.style
            [ Style.height 32
            , Style.width 32
            ]
        , Image.source (Image.defaultSource assetName)
        ]
        []
ohanhi commented 7 years ago

Great, thanks!