This library provides a dropdown that handles items of any type t
.
Items are not part of this component's internal model, meaning that there is a
single source of truth: your own Model
.
It sets the selected item by value, rather than by index, which can be useful
when the set of items is dynamic. User selection is communicated by returning
an Event that contains the selected item.
@docs The Dropdown (opaque) model.
@docs Events that are used to communicate changes in state relevant to @docs users of this component.
@docs Opaque type representing messages used to change internal state.
{ placeHolder : String
, closedClass : String
, openedClass : String
, menuClass : String
, buttonClass : String
, arrowUpClass : String
, arrowDownClass : String
, itemClass : String
, activeItemClass : String
}
@docs Customization settings.
defaultSettings : Settings
@docs Default look and feel settings.
init : Dropdown
@docs Initialize a Dropdown with default settings.
initWithSettings : Settings -> Dropdown
@docs Initialize a Dropdown with custom settings.
update : Msg t -> Dropdown -> ( Dropdown, Event t )
@docs Update a Dropdown. Returns the updated Dropdown and an Event @docs that communicates changes that are relevant to the outside world, if @docs any (e.g. item selection).
view : List t -> Maybe t -> (t -> String) -> Dropdown -> Html (Msg t)
@docs Render a Dropdown using provided items, optional selected item, and @docs function that returns a string representation of an item.