aforemny/material-components-web-elm/6.0.0

NOTE: the latest version is 9.1.0

Rerouted (regenerated, verified). Same repository and tag, but GitHub now builds the zip with different bytes, so it no longer matches the SHA-1 package.elm-lang.org recorded. The Lamdera package server serves a copy recovered from https://github.com/aforemny/material-components-web-elm.

What we checked: Tag 6.0.0 is still on github.com/aforemny/material-components-web-elm; its commit fa5f16f0eddc is from 2020-10-08 13:01 UTC, before the version was published (2020-10-08 13:03 UTC); every file Elm uses matches a copy in a Lamdera package cache from 2021-02-13, from before the change; elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/aforemny/material-components-web-elm/zipball/6.0.0/

Material.HelperText

Helper text gives context about a field’s input, such as how the input will be used. It should be visible either persistently or only on focus.

Table of Contents

Resources

Basic Usage

import Material.HelperText as HelperText
import Material.TextField as TextField


main =
    Html.div []
        [ TextField.filled
            (TextField.config
                |> TextField.setLabel (Just "Your name")
            )
        , HelperText.helperText HelperText.config
            "Please fill this"
        ]

Configuration

type Config msg

Configuration of a helper text

Default configuration of a helper text

Configuration Options

setPersistent : Bool -> Config msg -> Config msg

Specify whether a helper text should be persistent

Persistent helper texts always display regardless of whether the input has focus or not.

setValidation : Bool -> Config msg -> Config msg

Specify whether the helper text contains a validation message

Validation messages are highlighted red if their input is invalid.

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

Specify additional attributes

Helper Text

The helper line is expected to be a direct sibling of the text field it belongs to and the helper text is expected to be a direct child of the helper text line.

helperText : Config msg -> String -> Html msg

Helper text view function

The helper text is expected to be a direct child of the helper line.

Persistent Helper Text

A text field's helper text may show unconditionally by setting its setPersistent configuration option to True. By default a text field's helper text only shows when the text field has focus.

Helper Text with Character Counter

To have a text field or text area display a character counter, set its setMaxLength configuration option, and also add a characterCounter as a child of helperLine.

[ TextField.filled
    (TextField.config |> TextField.setMaxLength (Just 18))
, HelperText.helperLine [] [ HelperText.characterCounter [] ]
]
helperLine : List (Attribute msg) -> List (Html msg) -> Html msg

Helper text line view function

The helper line is expected to be the wrapping element of the helper text. It is expected to be a direct sibling of the text field that it belongs to.

characterCounter : List (Attribute msg) -> Html msg

Character counter view function