aforemny/material-components-web-elm/4.0.0

NOTE: the latest version is 9.1.0

Material.Chip.Input

Chips are compact elements that allow users to enter information, select a choice, filter content, or trigger an action.

Input chips are a variant of chips which enable user input by converting text into chips.

Table of Contents

Resources

Basic Usage

import Material.Chip.Input as InputChip
import Material.ChipSet.Input as InputChipSet


type Msg
    = ChipSelected String


main =
    InputChipSet.chipSet []
        [ InputChip.chip InputChip.config "Chip One"
        , InputChip.chip InputChip.config "Chip Two"
        ]

Configuration

type alias Config msg =
Config msg

Configuration of an input chip

config : Config msg

Default configuration of an input chip

Configuration Options

setOnClick : msg -> Config msg -> Config msg

Specify a message when the user clicks on a chip

setOnDelete : msg -> Config msg -> Config msg

Specify a message when the user clicks on a chip's trailing icon

setLeadingIcon : Maybe String -> Config msg -> Config msg

Specify whether an input chip displays a leading icon

setTrailingIcon : Maybe String -> Config msg -> Config msg

Specify whether an input chip displays a trailing icon

setAttributes : List (Attribute msg) -> Config msg -> Config msg

Specify additonal attributes

Input Chips

chip : Config msg -> String -> Chip msg

Input chip view function

type alias Chip msg =
Chip msg

Input chip type