1module Element.Input exposing
3 , checkbox, defaultCheckbox
4 , text, Placeholder, placeholder
5 , username, newPassword, currentPassword, email, search, spellChecked
7 , slider, Thumb, thumb, defaultThumb
8 , radio, radioRow, Option, option, optionWith, OptionState(..)
9 , Label, labelAbove, labelBelow, labelLeft, labelRight, labelHidden
17@docs checkbox, defaultCheckbox
22@docs text, Placeholder, placeholder
24We can also give a hint about what type of content our text field contains. This will allow things like autofill to work correctly.
26@docs username, newPassword, currentPassword, email, search, spellChecked
36@docs slider, Thumb, thumb, defaultThumb
41@docs radio, radioRow, Option, option, optionWith, OptionState
46@docs Label, labelAbove, labelBelow, labelLeft, labelRight, labelHidden
52import Element exposing (Attribute, Color, Element)
53import Element.Background as Background
54import Element.Border as Border
55import Element.Events as Events
56import Element.Font as Font
57import Element.Region as Region
61import Internal.Flag as Flag
62import Internal.Model as Internal
63import Internal.Style exposing (classes)
64import Json.Decode as Json
69 = Placeholder (List (Attribute msg)) (Element msg)
77 Element.rgb (186 / 255) (189 / 255) (182 / 255)
88placeholder : List (Attribute msg) -> Element msg -> Placeholder msg
100{-| Every input has a required `label`.
103 = Label LabelLocation (List (Attribute msg)) (Element msg)
108labelRight : List (Attribute msg) -> Element msg -> Label msg
114labelLeft : List (Attribute msg) -> Element msg -> Label msg
120labelAbove : List (Attribute msg) -> Element msg -> Label msg
126labelBelow : List (Attribute msg) -> Element msg -> Label msg
131{-| Sometimes you may need to have a label which is not visible, but is still accessible to screen readers.
133Seriously consider a visible label before using this.
135The situations where a hidden label makes sense:
137 - A searchbar with a `search` button right next to it.
138 - A `table` of inputs where the header gives the label.
140Basically, a hidden label makes sense when there are other contextual clues that sighted people can pick up on.
143labelHidden : String -> Label msg
148hiddenLabelAttribute label =
150 HiddenLabel textLabel ->
151 Internal.Describe (Internal.Label textLabel)
157{-| A standard button.
159The `onPress` handler will be fired either `onClick` or when the element is focused and the enter key has been pressed.
161 import Element.Input as Input
165 , label = text "My Button"
168`onPress` takes a `Maybe msg`. If you provide the value `Nothing`, then the button will be disabled.
174 { onPress : Maybe msg
175 , label : Element msg
178button attrs { onPress, label } =
181 -- We don't explicitly label this node as a button,
182 -- because buttons fire a bunch of times when you hold down the enter key.
183 -- We'd like to fire just once on the enter key, which means using keyup instead of keydown.
184 -- Because we have no way to disable keydown, though our messages get doubled.
186 (Element.width Element.shrink
187 :: Element.height Element.shrink
188 :: Internal.htmlClass
189 (classes.contentCenterX
191 ++ classes.contentCenterY
195 ++ classes.noTextSelection
198 :: focusDefault attrs
199 :: Internal.Describe Internal.Button
200 :: Internal.Attr (Html.Attributes.tabindex 0)
203 Internal.Attr (Html.Attributes.disabled True) :: attrs
211 (Internal.Unkeyed [ label ])
215 if List.any hasFocusStyle attrs then
219 Internal.htmlClass "focusable"
224 Internal.StyleClass _ (Internal.PseudoSelector Internal.Focus _) ->
232type alias Checkbox msg =
233 { onChange : Maybe (Bool -> msg)
234 , icon : Maybe (Element msg)
244 { onChange : Bool -> msg
245 , icon : Bool -> Element msg
250checkbox attrs { label, icon, checked, onChange } =
253 [ if isHiddenLabel label then
259 , Internal.Attr (Html.Events.onClick (onChange (not checked)))
263 if code == enter then
264 Just <| onChange (not checked)
266 else if code == space then
267 Just <| onChange (not checked)
274 , Element.width Element.fill
278 applyLabel attributes
284 Html.Attributes.attribute "role" "checkbox"
286 Html.Attributes.attribute "aria-checked" <|
292 , hiddenLabelAttribute label
294 , Element.height Element.fill
295 , Element.width Element.shrink
306 = Thumb (List (Attribute Never))
310thumb : List (Attribute Never) -> Thumb
319 [ Element.width (Element.px 16)
320 , Element.height (Element.px 16)
323 , Border.color (Element.rgb 0.5 0.5 0.5)
324 , Background.color (Element.rgb 1 1 1)
328{-| A slider input, good for capturing float values.
331 [ Element.height (Element.px 30)
333 -- Here is where we're creating/styling the "track"
334 , Element.behindContent
336 [ Element.width Element.fill
337 , Element.height (Element.px 2)
339 , Background.color grey
345 { onChange = AdjustValue
346 , label = Input.labelAbove [] (text "My Slider Value")
350 , value = model.sliderValue
355The `thumb` is the icon that you can move around.
357The slider can be vertical or horizontal depending on the width/height of the slider.
359 - `height fill` and `width (px someWidth)` will cause the slider to be vertical.
360 - `height (px someHeight)` and `width (px someWidth)` where `someHeight` > `someWidth` will also do it.
361 - otherwise, the slider will be horizontal.
363**Note:** If you want a slider for an `Int` value:
365 - set `step` to be `Just 1`, or some other whole value
366 - `value = toFloat model.myInt`
367 - And finally, round the value before making a message `onChange = round >> AdjustValue`
373 { onChange : Float -> msg
382slider attributes input =
384 (Thumb thumbAttributes) =
388 Internal.getWidth thumbAttributes
391 Internal.getHeight thumbAttributes
394 case ( trackWidth, trackHeight ) of
395 ( Nothing, Nothing ) ->
398 ( Just (Internal.Px w), Just (Internal.Px h) ) ->
401 ( Just (Internal.Px _), Just (Internal.Fill _) ) ->
408 Internal.getHeight attributes
411 Internal.getWidth attributes
413 ( spacingX, spacingY ) =
414 Internal.getSpacing attributes ( 5, 5 )
417 (input.value - input.min)
418 / (input.max - input.min)
423 - Width/Height of thumb so that the input can shadow it.
443 "thmb-" ++ thumbWidthString ++ "-" ++ thumbHeightString
450 Just (Internal.Px px) ->
451 String.fromInt px ++ "px"
461 Just (Internal.Px px) ->
462 String.fromInt px ++ "px"
468 [ Internal.Property "width"
470 , Internal.Property "height"
475 [ if isHiddenLabel input.label then
479 Element.spacingXY spacingX spacingY
486 Just (Internal.Px _) ->
497 Just (Internal.Px _) ->
507 (Maybe.withDefault Element.fill trackWidth)
509 (Maybe.withDefault (Element.px 20) trackHeight)
513 (Internal.NodeName "input")
514 [ hiddenLabelAttribute input.label
515 , Internal.StyleClass Flag.active
517 ("input[type=\"range\"]." ++ className ++ "::-moz-range-thumb")
520 , Internal.StyleClass Flag.hover
522 ("input[type=\"range\"]." ++ className ++ "::-webkit-slider-thumb")
525 , Internal.StyleClass Flag.focus
527 ("input[type=\"range\"]." ++ className ++ "::-ms-thumb")
530 , Internal.Attr (Html.Attributes.class (className ++ " focusable-parent"))
534 case String.toFloat str of
536 -- This should never happen because the browser
537 -- should always provide a Float.
545 Html.Attributes.type_ "range"
550 -- Note: If we set `any` here,
551 -- Firefox makes a single press of the arrows keys equal to 1
552 -- We could set the step manually to the effective range / 100
553 -- String.fromFloat ((input.max - input.min) / 100)
554 -- Which matches Chrome's default behavior
555 -- HOWEVER, that means manually moving a slider with the mouse will snap to that interval.
559 String.fromFloat step
562 Html.Attributes.min (String.fromFloat input.min)
564 Html.Attributes.max (String.fromFloat input.max)
566 Html.Attributes.value (String.fromFloat input.value)
569 Html.Attributes.attribute "orient" "vertical"
575 Maybe.withDefault (Element.px 20) trackHeight
578 Maybe.withDefault Element.fill trackWidth
581 Maybe.withDefault Element.fill trackWidth
584 Maybe.withDefault (Element.px 20) trackHeight
586 (Internal.Unkeyed [])
589 (Maybe.withDefault Element.fill trackWidth)
591 (Maybe.withDefault (Element.px 20) trackHeight)
593 -- This is after `attributes` because the thumb should be in front of everything.
594 ++ [ Element.behindContent <|
596 viewVerticalThumb factor thumbAttributes trackWidth
599 viewHorizontalThumb factor thumbAttributes trackHeight
607viewHorizontalThumb factor thumbAttributes trackHeight =
609 [ Element.width Element.fill
610 , Element.height (Maybe.withDefault Element.fill trackHeight)
614 [ Element.width (Element.fillPortion (round <| factor * 10000))
619 :: List.map (Internal.mapAttr Basics.never) thumbAttributes
623 [ Element.width (Element.fillPortion (round <| (abs <| 1 - factor) * 10000))
629viewVerticalThumb factor thumbAttributes trackWidth =
631 [ Element.height Element.fill
632 , Element.width (Maybe.withDefault Element.fill trackWidth)
636 [ Element.height (Element.fillPortion (round <| (abs <| 1 - factor) * 10000))
641 :: List.map (Internal.mapAttr Basics.never) thumbAttributes
645 [ Element.height (Element.fillPortion (round <| factor * 10000))
651type alias TextInput =
653 , spellchecked : Bool
654 , autofill : Maybe String
659 = TextInputNode String
665 { onChange : String -> msg
667 , placeholder : Maybe (Placeholder msg)
673 = Padding Int Int Int Int
681 attribute::width/height fill
684 attribute::fontsize/family/lineheight
686 attribute::nearby(placeholder)
687 attribute::width/height fill
695 special height for height-content
697 attribute::lineHeight
702textHelper : TextInput -> List (Attribute msg) -> Text msg -> Element msg
703textHelper textInput attrs textOptions =
706 defaultTextBoxStyle ++ attrs
709 [ Internal.Attr (Html.Events.onInput textOptions.onChange) ]
712 List.filter (not << forNearby) attributes
716 Internal.Nearby _ _ ->
722 ( inputNode, inputAttrs, inputChildren ) =
723 case textInput.type_ of
724 TextInputNode inputType ->
726 , [ value textOptions.text
727 , Internal.Attr (Html.Attributes.type_ inputType)
728 , spellcheck textInput.spellchecked
729 , Internal.htmlClass classes.inputText
730 , case textInput.autofill of
743 { maybePadding, heightContent, maybeSpacing, adjustedAttributes, maybeBorder } =
748 Internal.Describe _ ->
751 Internal.Height len ->
752 case found.heightContent of
755 | heightContent = Just (Internal.isContent len)
756 , adjustedAttributes = attr :: found.adjustedAttributes
762 Internal.StyleClass _ (Internal.BorderWidth _ t r b l) ->
763 case found.maybeBorder of
766 | maybeBorder = Just (Padding t r b l)
767 , adjustedAttributes = attr :: found.adjustedAttributes
773 Internal.StyleClass _ (Internal.PaddingStyle _ t r b l) ->
774 case found.maybePadding of
777 | maybePadding = Just (Padding t r b l)
779 -- Skip storing padding because it's being customized later
780 , adjustedAttributes = found.adjustedAttributes
786 Internal.StyleClass _ (Internal.SpacingStyle _ x y) ->
787 case found.maybeSpacing of
790 | maybeSpacing = Just y
791 , adjustedAttributes = attr :: found.adjustedAttributes
798 { found | adjustedAttributes = attr :: found.adjustedAttributes }
800 { maybePadding = Nothing
801 , heightContent = Nothing
802 , maybeBorder = Nothing
803 , maybeSpacing = Nothing
804 , adjustedAttributes = []
807 -- NOTE: This is where default text spacing is set
809 Maybe.withDefault 5 maybeSpacing
812 , [ spellcheck textInput.spellchecked
813 , Internal.htmlClass classes.inputMultiline
814 , Maybe.map autofill textInput.autofill
815 |> Maybe.withDefault Internal.NoAttribute
816 , case maybePadding of
820 Just (Padding t r b l) ->
822 { top = max 0 (t - (spacing // 2))
823 , bottom = max 0 (b - (spacing // 2))
827 , case heightContent of
832 textHeightContent textOptions.text spacing maybePadding maybeBorder
837 ++ adjustedAttributes
838 , [ Internal.unstyled (Html.text textOptions.text) ]
841 heightFillFromChild =
842 Internal.get attributes <|
845 Internal.Height (Internal.Fill _) ->
851 attributesFromChild =
852 Internal.get attributes <|
855 Internal.Width (Internal.Fill _) ->
858 Internal.Height (Internal.Fill _) ->
867 Internal.StyleClass _ (Internal.SpacingStyle _ _ _) ->
870 Internal.StyleClass _ (Internal.FontSize _) ->
873 Internal.StyleClass _ (Internal.FontFamily _ _) ->
880 Internal.get attributes <|
883 Internal.Nearby _ _ ->
890 Internal.get attributes <|
893 Internal.StyleClass _ (Internal.PaddingStyle _ _ _ _ _) ->
903 (Element.width Element.fill
906 , heightFillFromChild
907 , case textOptions.placeholder of
911 Just (Placeholder placeholderAttrs placeholderEl) ->
916 ++ [ Font.color charcoal
917 , Internal.htmlClass (classes.noTextSelection ++ " " ++ classes.passPointerEvents)
918 , Border.color (Element.rgba 0 0 0 0)
919 , Background.color (Element.rgba 0 0 0 0)
920 , Element.height Element.fill
921 , Element.width Element.fill
923 (if textOptions.text == "" then
940 (Internal.NodeName inputNode)
942 [ [ focusDefault attrs
943 , hiddenLabelAttribute textOptions.label
949 (Internal.Unkeyed inputChildren)
954 (Internal.Class Flag.cursor classes.cursorText
955 :: (if isHiddenLabel textOptions.label then
963 :: attributesFromChild
969textHeightContent textValue spacing maybePadding maybeBorder =
972 String.lines textValue
982 topBottom (Padding t _ b _) =
986 ((newlineCount - 1) * spacing)
987 + Maybe.withDefault 0 (Maybe.map topBottom maybePadding)
988 + Maybe.withDefault 0 (Maybe.map topBottom maybeBorder)
992 ++ String.fromInt count
994 ++ String.fromInt additionalSpacing
997 Internal.StyleClass Flag.heightTextAreaContent
998 (Internal.Single ("textarea-height-" ++ String.fromInt newlineCount)
1000 (heightValue newlineCount)
1006 List (Attribute msg)
1008 { onChange : String -> msg
1010 , placeholder : Maybe (Placeholder msg)
1016 { type_ = TextInputNode "text"
1017 , spellchecked = False
1018 , autofill = Nothing
1022{-| If spell checking is available, this input will be spellchecked.
1025 List (Attribute msg)
1027 { onChange : String -> msg
1029 , placeholder : Maybe (Placeholder msg)
1035 { type_ = TextInputNode "text"
1036 , spellchecked = True
1037 , autofill = Nothing
1043 List (Attribute msg)
1045 { onChange : String -> msg
1047 , placeholder : Maybe (Placeholder msg)
1053 { type_ = TextInputNode "search"
1054 , spellchecked = False
1055 , autofill = Nothing
1059{-| A password input that allows the browser to autofill.
1061It's `newPassword` instead of just `password` because it gives the browser a hint on what type of password input it is.
1063A password takes all the arguments a normal `Input.text` would, and also `show`, which will remove the password mask (e.g. `****` vs `pass1234`)
1067 List (Attribute msg)
1069 { onChange : String -> msg
1071 , placeholder : Maybe (Placeholder msg)
1076newPassword attrs pass =
1085 , spellchecked = False
1086 , autofill = Just "new-password"
1089 { onChange = pass.onChange
1091 , placeholder = pass.placeholder
1092 , label = pass.label
1098 List (Attribute msg)
1100 { onChange : String -> msg
1102 , placeholder : Maybe (Placeholder msg)
1107currentPassword attrs pass =
1116 , spellchecked = False
1117 , autofill = Just "current-password"
1120 { onChange = pass.onChange
1122 , placeholder = pass.placeholder
1123 , label = pass.label
1129 List (Attribute msg)
1131 { onChange : String -> msg
1133 , placeholder : Maybe (Placeholder msg)
1139 { type_ = TextInputNode "text"
1140 , spellchecked = False
1141 , autofill = Just "username"
1147 List (Attribute msg)
1149 { onChange : String -> msg
1151 , placeholder : Maybe (Placeholder msg)
1157 { type_ = TextInputNode "email"
1158 , spellchecked = False
1159 , autofill = Just "email"
1165 List (Attribute msg)
1167 { onChange : String -> msg
1169 , placeholder : Maybe (Placeholder msg)
1174multiline attrs multi =
1178 , spellchecked = multi.spellcheck
1179 , autofill = Nothing
1182 { onChange = multi.onChange
1184 , placeholder = multi.placeholder
1185 , label = multi.label
1189isHiddenLabel label =
1198applyLabel : List (Attribute msg) -> Label msg -> Element msg -> Element msg
1199applyLabel attrs label input =
1201 HiddenLabel labelText ->
1202 -- NOTE: This means that the label is applied outside of this function!
1203 -- It would be nice to unify this logic, but it's a little tricky
1206 (Internal.NodeName "label")
1208 (Internal.Unkeyed [ input ])
1210 Label position labelAttrs labelChild ->
1217 (Internal.Unkeyed [ labelChild ])
1223 (Internal.NodeName "label")
1225 (Internal.Unkeyed [ labelElement, input ])
1230 (Internal.NodeName "label")
1232 (Internal.Unkeyed [ input, labelElement ])
1237 (Internal.NodeName "label")
1239 (Internal.Unkeyed [ input, labelElement ])
1244 (Internal.NodeName "label")
1246 (Internal.Unkeyed [ labelElement, input ])
1249{-| Add choices to your radio and select menus.
1251type Option value msg
1252 = Option value (OptionState -> Element msg)
1263option : value -> Element msg -> Option value msg
1265 Option val (defaultRadioOption txt)
1269optionWith : value -> (OptionState -> Element msg) -> Option value msg
1270optionWith val view =
1280 { onChange = ChooseLunch
1281 , selected = Just model.lunch
1282 , label = Input.labelAbove (text "Lunch")
1284 [ Input.styledChoice Burrito <|
1296 , Input.option Taco (text "Taco!")
1297 , Input.option Gyro (text "Gyro")
1303 List (Attribute msg)
1305 { onChange : option -> msg
1306 , options : List (Option option msg)
1307 , selected : Maybe option
1315{-| Same as radio, but displayed as a row
1318 List (Attribute msg)
1320 { onChange : option -> msg
1321 , options : List (Option option msg)
1322 , selected : Maybe option
1330defaultRadioOption : Element msg -> OptionState -> Element msg
1331defaultRadioOption optionLabel status =
1333 [ Element.spacing 10
1335 , Element.width Element.shrink
1338 [ Element.width (Element.px 14)
1339 , Element.height (Element.px 14)
1340 , Background.color white
1344 Internal.htmlClass "focusable"
1347 Internal.NoAttribute
1349 -- , Border.shadow <|
1350 -- -- case status of
1352 -- -- { offset = ( 0, 0 )
1355 -- -- , color = Color.rgb 235 235 235
1358 -- -- { offset = ( 0, 0 )
1361 -- -- , color = Color.rgba 235 235 235 0
1364 -- { offset = ( 0, 0 )
1367 -- , color = Color.rgba 235 235 235 0
1382 Element.rgb (208 / 255) (208 / 255) (208 / 255)
1385 Element.rgb (208 / 255) (208 / 255) (208 / 255)
1388 Element.rgb (59 / 255) (153 / 255) (252 / 255)
1391 , Element.el [ Element.width Element.fill, Internal.htmlClass "unfocusable" ] optionLabel
1397 -> List (Attribute msg)
1399 { onChange : option -> msg
1400 , options : List (Option option msg)
1401 , selected : Maybe option
1405radioHelper orientation attrs input =
1407 renderOption (Option val view) =
1410 if Just val == input.selected then
1418 , case orientation of
1420 Element.width Element.shrink
1423 Element.width Element.fill
1424 , Events.onClick (input.onChange val)
1428 Html.Attributes.attribute "aria-checked"
1433 Html.Attributes.attribute "aria-checked"
1436 Html.Attributes.attribute "role" "radio"
1443 row (hiddenLabelAttribute input.label :: attrs)
1444 (List.map renderOption input.options)
1447 column (hiddenLabelAttribute input.label :: attrs)
1448 (List.map renderOption input.options)
1451 case input.options of
1455 (Option val _) :: _ ->
1456 List.foldl track ( NotFound, val, val ) input.options
1457 |> (\( found, b, a ) ->
1469 track opt ( found, prev, nxt ) =
1474 if Just val == input.selected then
1475 ( BeforeFound, prev, nxt )
1481 ( AfterFound, prev, val )
1484 ( found, prev, nxt )
1488 Internal.get attrs <|
1491 Internal.StyleClass _ (Internal.Transparency _ _) ->
1494 Internal.Class _ "hidden" ->
1502 Label _ labelAttrs _ ->
1504 Internal.get labelAttrs <|
1507 Internal.StyleClass _ (Internal.Transparency _ _) ->
1510 Internal.Class _ "hidden" ->
1519 hideIfEverythingisInvisible =
1520 if not labelVisible && not inputVisible then
1526 Internal.StyleClass _ style ->
1528 Internal.PseudoSelector pseudo styles ->
1531 List.filter forTransparency styles
1533 forTransparency psuedoStyle =
1535 Internal.Transparency _ _ ->
1557 Just <| Internal.StyleClass flag <| Internal.PseudoSelector pseudo transparent
1567 Internal.StyleClass Flag.transparency (Internal.Transparency "transparent" 1.0) :: pseudos
1578 Internal.Width (Internal.Fill _) ->
1581 Internal.Height (Internal.Fill _) ->
1591 (List.filterMap identity
1592 [ Just Element.alignLeft
1594 , Just (Internal.htmlClass "focus")
1595 , Just Region.announce
1598 Html.Attributes.attribute "role" "radiogroup"
1603 Just ( prev, next ) ->
1607 if code == leftArrow then
1608 Just (input.onChange prev)
1610 else if code == upArrow then
1611 Just (input.onChange prev)
1613 else if code == rightArrow then
1614 Just (input.onChange next)
1616 else if code == downArrow then
1617 Just (input.onChange next)
1619 else if code == space then
1620 case input.selected of
1622 Just (input.onChange prev)
1632 ++ hideIfEverythingisInvisible
1649column : List (Attribute msg) -> List (Internal.Element msg) -> Internal.Element msg
1650column attributes children =
1654 (Element.height Element.shrink
1655 :: Element.width Element.fill
1658 (Internal.Unkeyed children)
1661row : List (Attribute msg) -> List (Internal.Element msg) -> Internal.Element msg
1662row attributes children =
1666 (Element.width Element.fill
1669 (Internal.Unkeyed children)
1677onEnter : msg -> Attribute msg
1683onSpace : msg -> Attribute msg
1689onUpArrow : msg -> Attribute msg
1695onRightArrow : msg -> Attribute msg
1697 onKey rightArrow msg
1701onLeftArrow : msg -> Attribute msg
1707onDownArrow : msg -> Attribute msg
1758onKey : String -> msg -> Attribute msg
1759onKey desiredCode msg =
1762 if code == desiredCode then
1766 Json.fail "Not the enter key"
1769 Json.field "key" Json.string
1770 |> Json.andThen decode
1773 Html.Events.preventDefaultOn "keyup"
1774 (Json.map (\fired -> ( fired, True )) isKey)
1778-- preventKeydown : String -> a -> Attribute a
1779-- preventKeydown desiredCode msg =
1782-- if code == desiredCode then
1785-- Json.fail "Not the enter key"
1787-- Json.field "key" Json.string
1788-- |> Json.andThen decode
1790-- Events.onWithOptions "keydown"
1791-- { stopPropagation = False
1792-- , preventDefault = True
1798onKeyLookup : (String -> Maybe msg) -> Attribute msg
1804 Json.fail "No key matched"
1810 Json.field "key" Json.string
1811 |> Json.andThen decode
1813 Internal.Attr <| Html.Events.on "keyup" isKey
1817onFocusOut : msg -> Attribute msg
1819 Internal.Attr <| Html.Events.on "focusout" (Json.succeed msg)
1823onFocusIn : msg -> Attribute msg
1825 Internal.Attr <| Html.Events.on "focusin" (Json.succeed msg)
1828type_ : String -> Attribute msg
1830 Internal.Attr << Html.Attributes.type_
1834-- checked : Bool -> Attribute msg
1836-- Internal.Attr << Html.Attributes.checked
1839selected : Bool -> Attribute msg
1841 Internal.Attr << Html.Attributes.selected
1844name : String -> Attribute msg
1846 Internal.Attr << Html.Attributes.name
1849value : String -> Attribute msg
1851 Internal.Attr << Html.Attributes.value
1854tabindex : Int -> Attribute msg
1856 Internal.Attr << Html.Attributes.tabindex
1859disabled : Bool -> Attribute msg
1861 Internal.Attr << Html.Attributes.disabled
1864spellcheck : Bool -> Attribute msg
1866 Internal.Attr << Html.Attributes.spellcheck
1869readonly : Bool -> Attribute msg
1871 Internal.Attr << Html.Attributes.readonly
1874autofill : String -> Attribute msg
1876 Internal.Attr << Html.Attributes.attribute "autocomplete"
1880focusedOnLoad : Attribute msg
1882 Internal.Attr <| Html.Attributes.autofocus True
1889defaultTextBoxStyle : List (Attribute msg)
1890defaultTextBoxStyle =
1891 [ defaultTextPadding
1893 , Border.color darkGrey
1894 , Background.color white
1897 , Element.width Element.fill
1901defaultTextPadding : Attribute msg
1903 Element.paddingXY 12 12
1907defaultCheckbox : Bool -> Element msg
1908defaultCheckbox checked =
1910 [ Internal.htmlClass "focusable"
1911 , Element.width (Element.px 14)
1912 , Element.height (Element.px 14)
1920 Element.rgb (59 / 255) (153 / 255) (252 / 255)
1923 Element.rgb (211 / 255) (211 / 255) (211 / 255)
1930 Element.rgba (238 / 255) (238 / 255) (238 / 255) 0
1933 Element.rgb (238 / 255) (238 / 255) (238 / 255)
1935 , Background.color <|
1937 Element.rgb (59 / 255) (153 / 255) (252 / 255)
1950 [ Border.color white
1951 , Element.height (Element.px 6)
1952 , Element.width (Element.px 9)
1953 , Element.rotate (degrees -45)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list