Formerly leonardanyer/elm-combox. Search finds this package by either name.
This is a custom dropdown based on elm-selectize.
type alias Model =
{ language : Combox.Model }
init : ( Model, Cmd Msg )
init =
( { language = Accordion.empty }, Cmd.none )
type Msg
= ComboxMsg String Combox.Msg
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
ComboxMsg selectizeMsg ->
let
( language, cmd ) =
Combox.update msg model.combox
in
( { model | language = language }, Cmd.map ComboxMsg cmd )
view : Model -> Html Msg
view model =
Html.div []
[ Html.h3 [] [ Html.text "Dropdown Menus" ]
, Combox.config ComboxMsg
|> Combox.clear False
|> Combox.view model.language
]The custom dropdown menu produces these messages.
Create an initial configuration by calling the config function
title function defines the title that goes in the headerplaceholder function defines the placeholder of selectorclear function defines if the delete selection icon appearsoptions function defines the attributes html option listdisabled function defines if the selector is disabled or notCreate the view configuration, for example
view : Model -> Html Msg
view model =
Html.div []
[ Html.h3 [] [ Html.text "Dropdown Menus" ]
, Combox.config ComboxMsg
|> Combox.view model.language
]Initialize model with data
Initialize empty model
change the current settings of the title
change the current settings of the placeholder
change the current settings of clear
Change the current settings of the options
change the current settings of disabled
Get the current selection from the model
Define the dropdown identifier and basic elm-selectize model