aforemny/material-components-web-elm/2.1.1

NOTE: the latest version is 9.1.0

Material.Ripple

Material “ink ripple” interaction effect.

Ripples come in two variants. Use ripple for bounded ripple effects which work best when used for contained surfaces, and unboundedRipple for unbounded ripple effects which work best with icons.

Table of Contents

Resources

Basic Usage

import Material.Ripple exposing (ripple, rippleConfig)


main =
    Html.div []
        [ text "Click me!"
        , boundedRipple rippleConfig
        ]

Bounded Ripple

boundedRipple : RippleConfig msg -> Html msg

Bounded ripple variant

rippleConfig : RippleConfig msg

Default ripple configuration

type alias RippleConfig msg =
{ color : Maybe RippleColor
, additionalAttributes : List (Attribute msg)
}

Ripple configuration

Unbounded Ripple

Html.span []
    [ unboundedRipple rippleConfig
    , text "🙌"
    ]
unboundedRipple : RippleConfig msg -> Html msg

Unbounded ripple variant

Colored Ripple

If you want to set the ripple effect to either primary or secondary color, set its color configuration field to a RippleColor.

ripple { rippleConfig | color = Ripple.PrimaryColor }
= PrimaryColor
| AccentColor

Ripple color