This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Input multiple emails on elm
version 1.0.0
license BSD3-Clause
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.0
Committed At 2017-06-30 19:11:42 UTC
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/dom 1.1.1 <= v < 2.0.0 1.1.1
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

README

elm-multi-email-input Build Status

Input multiple emails on elm

Try it out

alt text

How to use it

Here's an example of a minimal integration scenario:

module Main exposing (main)

import Html exposing (Html)
import Html.Attributes as Attr
import Html.Events as Ev
import MultiEmailInput


main : Program Never Model Msg
main =
    Html.program
        { init = init
        , update = update
        , view = view
        , subscriptions = subscriptions
        }


type alias Model =
    { emails : List String
    , inputState : MultiEmailInput.State
    }


type Msg
    = MultiEmailInputMsg MultiEmailInput.Msg


init : ( Model, Cmd Msg )
init =
    ( { emails = []
      , inputState = MultiEmailInput.init "multi-email-textarea"
      }
    , Cmd.none
    )


subscriptions : Model -> Sub Msg
subscriptions model =
    Sub.none


update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
    case msg of
        MultiEmailInputMsg subMsg ->
            let
                ( nextState, nextEmails, nextCmd ) =
                    MultiEmailInput.update subMsg model.inputState model.emails
            in
            ( { model | emails = nextEmails, inputState = nextState }, Cmd.map MultiEmailInputMsg nextCmd )


view : Model -> Html Msg
view model =
    MultiEmailInput.view
        MultiEmailInputMsg
        []
        "Write an email here"
        model.emails
        model.inputState

Contribute

Any contributions or feedback are welcome!