MultiSelect component.
Config.ID
ID of a element.
State a
Opaque type for the component's state.
init : State a
Initialize a default and empty state.
get : State a -> List a
Get the data from the State
.
selected : State a -> List a
Get the selected items from the State
.
set : State a -> List a -> State a
Set the data in the State
.
select : List a -> State a -> State a
Set the selected items.
selectByID : List ID -> Config a msg -> State a -> State a
Select or unselect items by ID.
Config a msg
Opaque type for the component's configuration.
config : (a -> ID) -> (a -> String) -> (State a -> msg) -> Config a msg
Initialize the component's configuration.
config : MultiSelect.Config User Msg
config =
MultiSelect.config
(String.fromInt << .id)
(\x -> x.firstname ++ " " ++ x.lastname)
OnSelectState
withClass : String -> Config a msg -> Config a msg
Add custom class to the component.
withPlaceholder : String -> Config a msg -> Config a msg
Customize the search input placeholder.
view : Config a msg -> State a -> Html msg
Component's view.
subscriptions : Config a msg -> State a -> Platform.Sub.Sub msg
Component's subscriptions.