aforemny/material-components-web-elm/4.0.0

NOTE: the latest version is 9.1.0

Material.Chip.Action

Action chips offer actions related to primary content. They should appear dynamically and contextually in a UI.

An alternative to action chips are buttons, which should appear persistently and consistently.

Table of Contents

Resources

Basic Usage

import Material.Chip.Action as ActionChip
import Material.ChipSet.Action as ActionChipSet


type Msg
    = Clicked String


main =
    ActionChipSet.chipSet []
        [ ActionChip.chip
            (ActionChip.config
                |> ActionChip.setOnClick Clicked "Chip One"
            )
            "Chip One"
        , ActionChip.chip ActionChip.config "Chip Two"
        ]

Configuration

type alias Config msg =
Config msg

Configuration of an action chip

config : Config msg

Default configuration of an action chip

Configuration Options

setOnClick : msg -> Config msg -> Config msg

Specify a message when the user clicks on a chip

setIcon : Maybe String -> Config msg -> Config msg

Specify whether the chip displays an icon

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

Specify additional attributes

Action Chips

chip : Config msg -> String -> Chip msg

Action chip view function

type alias Chip msg =
Chip msg

Action chip type