Select provides a single-option select menus.
This module concerns the select items. If you are looking for the select container, refer to Material.Select.
import Material.Select as Select
import Material.Select.Item as SelectItem
type Msg
= ValueChanged String
main =
Select.filled
(Select.config
|> Select.setLabel (Just "Fruit")
|> Select.setSelected (Just "")
|> Select.setOnChange ValueChanged
)
(SelectItem.selectItem
(SelectItem.config { value = "" })
""
)
[ SelectItem.selectItem
(SelectItem.config { value = "Apple" })
"Apple"
]Default configuration of a select item
Specify whether a select item should be disabled
Disabled select items cannot be interacted with and have not visual interaction effect.
Specify additional attributes
Select item type
Select item constructor
Select items may be disabled by setting their setDisabled configuration option
to True.
SelectItem.selectItem
(SelectItem.config { value = "Apple" }
|> SelectItem.setDisabled True
)
"Apple"
Configuration of a select item