abadi199/elm-input-extra/5.2.4

NOTE: the latest version is 5.2.6

Dropdown

Dropdown

Options

type alias Item =
{ value : String
, text : String
, enabled : Bool
}

Item is the individual content of the dropdown.

  • value is the item value or id
  • text is the display text of the dropdown item.
  • enabled is a flag to indicate whether the item is enabled or disabled.
type alias Options msg =
{ items : List Item
, emptyItem : Maybe Item
, onChange : Maybe String -> msg
}

Options for the dropdown.

  • items is content of the dropdown.
  • emptyItem is the item for when the nothing is selected. Set to Nothing for no empty item.
  • onChange is the message for when the selected value in the dropdown is changed.
defaultOptions : (Maybe String -> msg) -> Options msg

Default Options, will give you empty dropdown with no empty item

View