/elm-autocomplete

Autocomplete for Elm apps; in Elm

Primary LanguageElmBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Elm Autocomplete

An Autocomplete component in Elm because typing is hard.

Here's a simple example.

main =
  let
    updateAutocomplete msg autocomplete =
      let
        ( updatedAutocomplete, status ) = Autocomplete.update msg autocomplete
        -- status communicates extra information the parent on every update
        -- e.g. when the selection changes, the value changes, or the user has triggered a completion
      in
        updatedAutocomplete
  in
    Html.beginnerProgram
      { model = Autocomplete.init [ "elm", "makes", "coding", "life", "easy" ]
      , update = updateAutocomplete
      , view = Autocomplete.view
      }

Demos

Github mention style defaults

simple-autocomplete-elm

Custom styles via CSS classnames. Maybe insert custom HTML for items

typeahead-elm

Control autocomplete inside a textarea or contenteditable

mentions

Try it out

Find these examples and more in the ./examples folder.