NoRedInk/noredink-ui/8.3.0

NOTE: the latest version is 35.9.3

Nri.Ui.TextInput.V5

Changes from V4

  • adds a password input
type alias Model value msg =
{ label : String
, isInError : Bool
, onInput : value -> msg
, onBlur : Maybe msg
, placeholder : String
, value : value
, autofocus : Bool
, showLabel : Bool
, type_ : InputType value
}
view : Model value msg -> Html msg
writing : Model value msg -> Html msg
generateId : String -> String

Gives you the DOM element id that will be used by a TextInput.view with the given label. This is for use when you need the DOM element id for use in javascript (such as trigger an event to focus a particular text input)

Input types

type InputType value
number : InputType (Maybe Int)

An input that allows integer entry

float : InputType (Maybe Float)

An input that allows float entry

text : InputType String

An input that allows text entry

An input that allows password entry

email : InputType String

An input that is optimized for email entry

NOTE: this uses inputmode="email" so that mobile devices will use the email keyboard, but not type="email" because that would enable browser-provided validation which is inconsistent and at odds with our validation UI.