A password input that allows the browser to autofill.
It's newPassword instead of just password because it gives the browser a hint on what type of password input it is.
A password takes all the arguments a normal Input.text would, and also show, which will remove the password mask (e.g. **** vs pass1234)
A slider input, good for receiving float values.
Input.slider
[ Element.height (Element.px 30)
-- Here is where we're creating/styling the "track"
, Element.behindContent
(Element.el
[ Element.width Element.fill
, Element.height (Element.px 2)
, Element.centerY
, Background.color grey
, Border.rounded 2
]
Element.none
)
]
{ onChange = AdjustValue
, label = Input.labelAbove [] (text "My Slider Value")
, min = 0
, max = 75
, step = Nothing
, value = model.sliderValue
, thumb =
Input.defaultThumb
}The thumb is the icon that you can move around.
The slider can be vertical or horizontal depending on the width/height of the slider.
- `height fill` and `width (px someWidth)` will cause the slider to be vertical.
- `height (px someHeight)` and `width (px someWidth)` where `someHeight` > `someWidth` will also do it.
- otherwise, the sldier will be horizontal.Input.radio
[ padding 10
, spacing 20
]
{ onChange = ChooseLunch
, selected = Just model.lunch
, label = Input.labelAbove (text "Lunch")
, options =
[ Input.styledChoice Burrito <|
\selected ->
Element.row
[ spacing 5 ]
[ el None [] <|
if selected then
text ":D"
else
text ":("
, text "burrito"
]
, Input.option Taco (text "Taco!")
, Input.option Gyro (text "Gyro")
]
}Same as radio, but displayed as a row
Add choices to your radio and select menus.
Every input has a required label.
A standard button.
The
onPresshandler will be fired eitheronClickor when the element is focused and the enter key has been pressed.onPresstakes aMaybe msg. If you provide the valueNothing, then the button will be disabled.