Create an input[type="password"].
Create an input[type="number"].
Input.import Html
import Prima.Pyxis.Form.Input as Input
import Prima.Pyxis.Form.Validation as Validation
...
type Msg =
OnInput String
type alias Model =
{ username: Maybe String }
...
view : Html Msg
view =
Html.div
[]
(Input.email .username OnInput
|> Input.withClass "my-custom-class"
|> Input.withValidation (Maybe.andThen validate << .username)
)
validate : String -> Validation.Type
validate str =
if String.isEmpty str then
Just <| Validation.ErrorWithMessage "Username is empty".
else
NothingAdds a generic Html.Attribute to the Input.
Adds a default value to the Input.
Useful to teach the component about it's pristine/touched state.
Adds a disabled Html.Attribute to the Input.
Adds a size of Medium to the Input.
Sets a size of Small to the Input.
Adds a size of Large to the Input.
Adds a placeholder Html.Attribute to the Input.
Adds a class to the Input which overrides all the previous.
Prepends an InputGroup with custom Html.
Appends an InputGroup with custom Html.
Adds a class to the InputGroup which wraps the Input.
Attaches the onBlur event to the Input.
Attaches the onFocus event to the Input.
Adds a Validation rule to the Input.
Represent the opaque
Inputconfiguration.