Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gribouille/elm-multiselect
https://github.com/gribouille/elm-multiselect
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gribouille/elm-multiselect
- Owner: gribouille
- License: mpl-2.0
- Created: 2020-10-21T10:41:30.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-13T17:09:15.000Z (almost 4 years ago)
- Last Synced: 2024-10-08T11:52:41.498Z (29 days ago)
- Language: SCSS
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-multiselect
ELM multiselect component.
## Example
```elm
type alias Model =
{ state : MultiSelect.State
}type Msg
= OnState MultiSelect.Statedata : List String
data =
[ ... ]init : Model
init =
{ state = MultiSelect.init []
}view : Model -> Html Msg
view model =
...
div [] [ text <| "Values: " ++ String.join ", " (MultiSelect.values model.state)
...
MultiSelect.view (MultiSelect.config "myid" OnState data) model.state
...update : Msg -> Model -> Model
update msg model =
case msg of
OnState s ->
{ model | state = s }
```## Development
Execute the example:
```
> cd examples
> npm run dev
```open `http://0.0.0.0:3000`.
## License
This project is licensed under [Mozilla Public License Version 2.0](./LICENSE).