supermacro / elm-antd / Ant.Input

Input widget for data entry

Creating an input


type Input msg

Represents a customizeable input.

input : (String -> msg) -> Input msg

Create a customizeable input component

Modifying the input


type InputSize
    = Default
    | Large
    | Small

Determines the vertical height of the input

withSize : InputSize -> Input msg -> Input msg

Change the size of the input

withPasswordType : (Basics.Bool -> msg) -> Basics.Bool -> Input msg -> Input msg

Modify the type of the input.

input InputMsg
    |> withPasswordType VisibilityToggled model.visibility
    |> toHtml model.inputValue

withPlaceholder : String -> Input msg -> Input msg

Add a placeholder to the input

withTextAreaType : { rows : Basics.Int } -> Input msg -> Input msg

Turn the input into a text area. You must specify the vertical height of the text area in rows as defined by the textarea spec.

If you specify a value less than 1 for rows, then we'll use a default value of 4.

view : Html msg
view =
    input TextAreaVAlueChanged
        |> withTextAreaType { rows = 10 }
        |> toHtml

Rendering the input

toHtml : String -> Input msg -> Html msg

Convert the input into a Html msg