Chips are compact elements that allow users to enter information, select a choice, filter content, or trigger an action.
Choice chips are a variant of chips which allow single selection from a set of options.
import Material.Chip.Choice as ChoiceChip
import Material.ChipSet.Choice as ChoiceChipSet
type Color
= Red
| Blue
type Msg
= ColorChanged Color
main =
ChoiceChipSet.chipSet
(ChoiceChipSet.config
{ toLabel =
\color ->
case color of
Red ->
"Red"
Blue ->
"Blue"
}
|> ChoiceChipSet.setSelected (Just Red)
|> ChocieChipSet.setOnClick ColorChanged
)
[ ChoiceChip.chip ChoiceChip.config Red
, ChoiceChip.chip ChoiceChip.config Blue
]Default configuration of a choice chip
Specify whether the chip displays an icon
Specify additional attributes
Choice chip view function
Choice chip type
Configuration of a choice chip