Chips are compact elements that allow users to enter information, select a choice, filter content, or trigger an action.
import Material.Chips
exposing
( choiceChip
, choiceChipConfig
, choiceChipSet
)
type Msg
= ChipSelected String
main =
[ choiceChipSet []
[ choiceChip
{ choiceChipConfig
| selected = True
, onClick = Just (ChipSelected "One")
}
"Chip One"
, choiceChip
{ choiceChipConfig
| onClick = Just (ChipSelected "Two")
}
"Chip Two"
]
]Choice chips are a variant of chips which allow single selection from a set of options.
choiceChipSet []
[ choiceChip
{ choiceChipConfig
| selected = True
, onClick = Just (ChipSelected "One")
}
"Chip One"
, choiceChip
{ choiceChipConfig
| onClick = Just (ChipSelected "Two")
}
"Chip Two"
]Choice chip view function
Choice Chip type
Default configuration of a choice chip
Configuration of a choice chip
Filter chips are a variant of chips which allow multiple selection from a set of options. When a filter chip is selected, a checkmark appears as the leading icon. If the chip already has a leading icon, the checkmark replaces it.
filterChipSet []
[ filterChip
{ filterChipConfig
| selected = True
, onClick = Just (ChipSelected "Chip One")
}
"Tops"
, filterChip
{ filterChipConfig
| onClick = Just (ChipSelected "Chip Two")
}
"Shoes"
]Filter chip container
Filter chip view function
Filter chip type
Default configuration of a filter chip
Configuration of a filter chip
Input chips are a variant of chips which enable user input by converting text into chips.
inputChipSet []
[ inputChip inputChipConfig "Chip One"
, inputChip inputChipConfig "Chip Two"
]Input chip container
Input chip type
Default configuration of a input chip
Configuration of a input chip
Choice chip container