MDC Select provides Material Design single-option select menus. It supports
using the browser's native <select> element, or a MDC Menu. It is fully
accessible, and fully RTL-aware.
import Material.Select
exposing
( select
, selectConfig
, selectOption
, selectOptionConfig
)
type Msg
= ValueChanged String
main =
filledSelect
{ selectConfig
| label = "Fruit"
, value = Just ""
, onChange = Just ValueChanged
}
[ selectOption
{ selectOptionConfig | value = "" }
[ text "" ]
, selectOption
{ selectOptionConfig | value = "Apple" }
[ text "Apple" ]
]Default configuration of a select
Configuration of a select
Select option view function
Default configuration of a select option
Configuration of a select option
Select option type
Instead of a filled select, you may choose a select with a outline by using the
outlinedSelect view function.
outlinedSelect selectConf
[ selectOption selectOptionConf "" ]Outlined select view function
To disable a select, set its disabled configuration field to True.
filledSelect
{ selectConfig | disabled = True }
[ selectOption { selectOptionConfig | value = "" }
[ text "" ]
]To disable one select's option, set its disabled configuration field to True.
selectOption { selectOptionConfig | disabled = True }
[ text "" ]This is particularly useful on the first emply option if you have a select that must be filled but is not initially filled.
TODO
TODO
Filled select view function