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 works 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
676inheritablePlaceholderAttributes attr =
678 Internal.StyleClass _ (Internal.PaddingStyle _ _ _ _ _) ->
681 Internal.StyleClass _ (Internal.BorderWidth _ _ _ _ _) ->
684 Internal.StyleClass _ (Internal.Transform _) ->
696 attribute::width/height fill
699 attribute::fontsize/family/lineheight
701 attribute::nearby(placeholder)
702 attribute::width/height fill
710 special height for height-content
712 attribute::lineHeight
717textHelper : TextInput -> List (Attribute msg) -> Text msg -> Element msg
718textHelper textInput attrs textOptions =
721 defaultTextBoxStyle ++ attrs
724 [ Internal.Attr (Html.Events.onInput textOptions.onChange) ]
727 List.filter inheritablePlaceholderAttributes attributes
730 List.filter (not << forNearby) attributes
734 Internal.Nearby _ _ ->
740 ( inputNode, inputAttrs, inputChildren ) =
741 case textInput.type_ of
742 TextInputNode inputType ->
744 , [ value textOptions.text
745 , Internal.Attr (Html.Attributes.type_ inputType)
746 , spellcheck textInput.spellchecked
747 , Internal.htmlClass classes.inputText
748 , case textInput.autofill of
761 { maybePadding, heightContent, maybeSpacing, adjustedAttributes, maybeBorder } =
762 (value textOptions.text :: attributes)
766 Internal.Describe _ ->
769 Internal.Height len ->
770 case found.heightContent of
773 | heightContent = Just (Internal.isContent len)
774 , adjustedAttributes = attr :: found.adjustedAttributes
780 Internal.StyleClass _ (Internal.BorderWidth _ t r b l) ->
781 case found.maybeBorder of
784 | maybeBorder = Just (Padding t r b l)
785 , adjustedAttributes = attr :: found.adjustedAttributes
791 Internal.StyleClass _ (Internal.PaddingStyle _ t r b l) ->
792 case found.maybePadding of
795 | maybePadding = Just (Padding t r b l)
797 -- Skip storing padding because it's being customized later
798 , adjustedAttributes = found.adjustedAttributes
804 Internal.StyleClass _ (Internal.SpacingStyle _ x y) ->
805 case found.maybeSpacing of
808 | maybeSpacing = Just y
809 , adjustedAttributes = attr :: found.adjustedAttributes
816 { found | adjustedAttributes = attr :: found.adjustedAttributes }
818 { maybePadding = Nothing
819 , heightContent = Nothing
820 , maybeBorder = Nothing
821 , maybeSpacing = Nothing
822 , adjustedAttributes = []
825 -- NOTE: This is where default text spacing is set
827 Maybe.withDefault 5 maybeSpacing
830 , [ spellcheck textInput.spellchecked
831 , Internal.htmlClass classes.inputMultiline
832 , Maybe.map autofill textInput.autofill
833 |> Maybe.withDefault Internal.NoAttribute
834 , case maybePadding of
838 Just (Padding t r b l) ->
840 { top = max 0 (t - (spacing // 2))
841 , bottom = max 0 (b - (spacing // 2))
845 , case heightContent of
850 textHeightContent textOptions.text spacing maybePadding maybeBorder
855 ++ adjustedAttributes
856 , [ Internal.unstyled (Html.text textOptions.text) ]
859 heightFillFromChild =
860 Internal.get attributes <|
863 Internal.Height (Internal.Fill _) ->
869 attributesFromChild =
870 Internal.get attributes <|
873 Internal.Width (Internal.Fill _) ->
876 Internal.Height (Internal.Fill _) ->
885 Internal.StyleClass _ (Internal.SpacingStyle _ _ _) ->
888 Internal.StyleClass _ (Internal.FontSize _) ->
891 Internal.StyleClass _ (Internal.FontFamily _ _) ->
898 Internal.get attributes <|
901 Internal.Nearby _ _ ->
908 Internal.get attributes <|
911 Internal.StyleClass _ (Internal.PaddingStyle _ _ _ _ _) ->
921 (Element.width Element.fill
924 , heightFillFromChild
925 , case textOptions.placeholder of
929 Just (Placeholder placeholderAttrs placeholderEl) ->
934 ++ [ Font.color charcoal
935 , Internal.htmlClass (classes.noTextSelection ++ " " ++ classes.passPointerEvents)
936 , Border.color (Element.rgba 0 0 0 0)
937 , Background.color (Element.rgba 0 0 0 0)
938 , Element.height Element.fill
939 , Element.width Element.fill
941 (if textOptions.text == "" then
958 (Internal.NodeName inputNode)
960 [ [ focusDefault attrs
961 , hiddenLabelAttribute textOptions.label
967 (Internal.Unkeyed inputChildren)
972 (Internal.Class Flag.cursor classes.cursorText
973 :: (if isHiddenLabel textOptions.label then
981 :: attributesFromChild
987textHeightContent textValue spacing maybePadding maybeBorder =
990 String.lines textValue
1000 topBottom (Padding t _ b _) =
1004 ((newlineCount - 1) * spacing)
1005 + Maybe.withDefault 0 (Maybe.map topBottom maybePadding)
1006 + Maybe.withDefault 0 (Maybe.map topBottom maybeBorder)
1010 ++ String.fromInt count
1012 ++ String.fromInt additionalSpacing
1015 Internal.StyleClass Flag.heightTextAreaContent
1016 (Internal.Single ("textarea-height-" ++ String.fromInt newlineCount)
1018 (heightValue newlineCount)
1024 List (Attribute msg)
1026 { onChange : String -> msg
1028 , placeholder : Maybe (Placeholder msg)
1034 { type_ = TextInputNode "text"
1035 , spellchecked = False
1036 , autofill = Nothing
1040{-| If spell checking is available, this input will be spellchecked.
1043 List (Attribute msg)
1045 { onChange : String -> msg
1047 , placeholder : Maybe (Placeholder msg)
1053 { type_ = TextInputNode "text"
1054 , spellchecked = True
1055 , autofill = Nothing
1061 List (Attribute msg)
1063 { onChange : String -> msg
1065 , placeholder : Maybe (Placeholder msg)
1071 { type_ = TextInputNode "search"
1072 , spellchecked = False
1073 , autofill = Nothing
1077{-| A password input that allows the browser to autofill.
1079It's `newPassword` instead of just `password` because it gives the browser a hint on what type of password input it is.
1081A password takes all the arguments a normal `Input.text` would, and also `show`, which will remove the password mask (e.g. `****` vs `pass1234`)
1085 List (Attribute msg)
1087 { onChange : String -> msg
1089 , placeholder : Maybe (Placeholder msg)
1094newPassword attrs pass =
1103 , spellchecked = False
1104 , autofill = Just "new-password"
1107 { onChange = pass.onChange
1109 , placeholder = pass.placeholder
1110 , label = pass.label
1116 List (Attribute msg)
1118 { onChange : String -> msg
1120 , placeholder : Maybe (Placeholder msg)
1125currentPassword attrs pass =
1134 , spellchecked = False
1135 , autofill = Just "current-password"
1138 { onChange = pass.onChange
1140 , placeholder = pass.placeholder
1141 , label = pass.label
1147 List (Attribute msg)
1149 { onChange : String -> msg
1151 , placeholder : Maybe (Placeholder msg)
1157 { type_ = TextInputNode "text"
1158 , spellchecked = False
1159 , autofill = Just "username"
1165 List (Attribute msg)
1167 { onChange : String -> msg
1169 , placeholder : Maybe (Placeholder msg)
1175 { type_ = TextInputNode "email"
1176 , spellchecked = False
1177 , autofill = Just "email"
1183 List (Attribute msg)
1185 { onChange : String -> msg
1187 , placeholder : Maybe (Placeholder msg)
1192multiline attrs multi =
1196 , spellchecked = multi.spellcheck
1197 , autofill = Nothing
1200 { onChange = multi.onChange
1202 , placeholder = multi.placeholder
1203 , label = multi.label
1207isHiddenLabel label =
1216applyLabel : List (Attribute msg) -> Label msg -> Element msg -> Element msg
1217applyLabel attrs label input =
1219 HiddenLabel labelText ->
1220 -- NOTE: This means that the label is applied outside of this function!
1221 -- It would be nice to unify this logic, but it's a little tricky
1224 (Internal.NodeName "label")
1226 (Internal.Unkeyed [ input ])
1228 Label position labelAttrs labelChild ->
1235 (Internal.Unkeyed [ labelChild ])
1241 (Internal.NodeName "label")
1243 (Internal.Unkeyed [ labelElement, input ])
1248 (Internal.NodeName "label")
1250 (Internal.Unkeyed [ input, labelElement ])
1255 (Internal.NodeName "label")
1257 (Internal.Unkeyed [ input, labelElement ])
1262 (Internal.NodeName "label")
1264 (Internal.Unkeyed [ labelElement, input ])
1267{-| Add choices to your radio and select menus.
1269type Option value msg
1270 = Option value (OptionState -> Element msg)
1281option : value -> Element msg -> Option value msg
1283 Option val (defaultRadioOption txt)
1287optionWith : value -> (OptionState -> Element msg) -> Option value msg
1288optionWith val view =
1298 { onChange = ChooseLunch
1299 , selected = Just model.lunch
1300 , label = Input.labelAbove (text "Lunch")
1302 [ Input.styledChoice Burrito <|
1314 , Input.option Taco (text "Taco!")
1315 , Input.option Gyro (text "Gyro")
1321 List (Attribute msg)
1323 { onChange : option -> msg
1324 , options : List (Option option msg)
1325 , selected : Maybe option
1333{-| Same as radio, but displayed as a row
1336 List (Attribute msg)
1338 { onChange : option -> msg
1339 , options : List (Option option msg)
1340 , selected : Maybe option
1348defaultRadioOption : Element msg -> OptionState -> Element msg
1349defaultRadioOption optionLabel status =
1351 [ Element.spacing 10
1353 , Element.width Element.shrink
1356 [ Element.width (Element.px 14)
1357 , Element.height (Element.px 14)
1358 , Background.color white
1362 Internal.htmlClass "focusable"
1365 Internal.NoAttribute
1367 -- , Border.shadow <|
1368 -- -- case status of
1370 -- -- { offset = ( 0, 0 )
1373 -- -- , color = Color.rgb 235 235 235
1376 -- -- { offset = ( 0, 0 )
1379 -- -- , color = Color.rgba 235 235 235 0
1382 -- { offset = ( 0, 0 )
1385 -- , color = Color.rgba 235 235 235 0
1400 Element.rgb (208 / 255) (208 / 255) (208 / 255)
1403 Element.rgb (208 / 255) (208 / 255) (208 / 255)
1406 Element.rgb (59 / 255) (153 / 255) (252 / 255)
1409 , Element.el [ Element.width Element.fill, Internal.htmlClass "unfocusable" ] optionLabel
1415 -> List (Attribute msg)
1417 { onChange : option -> msg
1418 , options : List (Option option msg)
1419 , selected : Maybe option
1423radioHelper orientation attrs input =
1425 renderOption (Option val view) =
1428 if Just val == input.selected then
1436 , case orientation of
1438 Element.width Element.shrink
1441 Element.width Element.fill
1442 , Events.onClick (input.onChange val)
1446 Html.Attributes.attribute "aria-checked"
1451 Html.Attributes.attribute "aria-checked"
1454 Html.Attributes.attribute "role" "radio"
1461 row (hiddenLabelAttribute input.label :: attrs)
1462 (List.map renderOption input.options)
1465 column (hiddenLabelAttribute input.label :: attrs)
1466 (List.map renderOption input.options)
1469 case input.options of
1473 (Option val _) :: _ ->
1474 List.foldl track ( NotFound, val, val ) input.options
1475 |> (\( found, b, a ) ->
1487 track opt ( found, prev, nxt ) =
1492 if Just val == input.selected then
1493 ( BeforeFound, prev, nxt )
1499 ( AfterFound, prev, val )
1502 ( found, prev, nxt )
1510 Internal.Width (Internal.Fill _) ->
1513 Internal.Height (Internal.Fill _) ->
1523 (List.filterMap identity
1524 [ Just Element.alignLeft
1526 , Just (Internal.htmlClass "focus")
1527 , Just Region.announce
1530 Html.Attributes.attribute "role" "radiogroup"
1535 Just ( prev, next ) ->
1539 if code == leftArrow then
1540 Just (input.onChange prev)
1542 else if code == upArrow then
1543 Just (input.onChange prev)
1545 else if code == rightArrow then
1546 Just (input.onChange next)
1548 else if code == downArrow then
1549 Just (input.onChange next)
1551 else if code == space then
1552 case input.selected of
1554 Just (input.onChange prev)
1564 -- ++ hideIfEverythingisInvisible
1581column : List (Attribute msg) -> List (Internal.Element msg) -> Internal.Element msg
1582column attributes children =
1586 (Element.height Element.shrink
1587 :: Element.width Element.fill
1590 (Internal.Unkeyed children)
1593row : List (Attribute msg) -> List (Internal.Element msg) -> Internal.Element msg
1594row attributes children =
1598 (Element.width Element.fill
1601 (Internal.Unkeyed children)
1609onEnter : msg -> Attribute msg
1615onSpace : msg -> Attribute msg
1621onUpArrow : msg -> Attribute msg
1627onRightArrow : msg -> Attribute msg
1629 onKey rightArrow msg
1633onLeftArrow : msg -> Attribute msg
1639onDownArrow : msg -> Attribute msg
1690onKey : String -> msg -> Attribute msg
1691onKey desiredCode msg =
1694 if code == desiredCode then
1698 Json.fail "Not the enter key"
1701 Json.field "key" Json.string
1702 |> Json.andThen decode
1705 Html.Events.preventDefaultOn "keyup"
1706 (Json.map (\fired -> ( fired, True )) isKey)
1710-- preventKeydown : String -> a -> Attribute a
1711-- preventKeydown desiredCode msg =
1714-- if code == desiredCode then
1717-- Json.fail "Not the enter key"
1719-- Json.field "key" Json.string
1720-- |> Json.andThen decode
1722-- Events.onWithOptions "keydown"
1723-- { stopPropagation = False
1724-- , preventDefault = True
1730onKeyLookup : (String -> Maybe msg) -> Attribute msg
1736 Json.fail "No key matched"
1742 Json.field "key" Json.string
1743 |> Json.andThen decode
1745 Internal.Attr <| Html.Events.on "keyup" isKey
1749onFocusOut : msg -> Attribute msg
1751 Internal.Attr <| Html.Events.on "focusout" (Json.succeed msg)
1755onFocusIn : msg -> Attribute msg
1757 Internal.Attr <| Html.Events.on "focusin" (Json.succeed msg)
1760type_ : String -> Attribute msg
1762 Internal.Attr << Html.Attributes.type_
1766-- checked : Bool -> Attribute msg
1768-- Internal.Attr << Html.Attributes.checked
1771selected : Bool -> Attribute msg
1773 Internal.Attr << Html.Attributes.selected
1776name : String -> Attribute msg
1778 Internal.Attr << Html.Attributes.name
1781value : String -> Attribute msg
1783 Internal.Attr << Html.Attributes.value
1786tabindex : Int -> Attribute msg
1788 Internal.Attr << Html.Attributes.tabindex
1791disabled : Bool -> Attribute msg
1793 Internal.Attr << Html.Attributes.disabled
1796spellcheck : Bool -> Attribute msg
1798 Internal.Attr << Html.Attributes.spellcheck
1801readonly : Bool -> Attribute msg
1803 Internal.Attr << Html.Attributes.readonly
1806autofill : String -> Attribute msg
1808 Internal.Attr << Html.Attributes.attribute "autocomplete"
1812focusedOnLoad : Attribute msg
1814 Internal.Attr <| Html.Attributes.autofocus True
1821defaultTextBoxStyle : List (Attribute msg)
1822defaultTextBoxStyle =
1823 [ defaultTextPadding
1825 , Border.color darkGrey
1826 , Background.color white
1829 , Element.width Element.fill
1833defaultTextPadding : Attribute msg
1835 Element.paddingXY 12 12
1839defaultCheckbox : Bool -> Element msg
1840defaultCheckbox checked =
1842 [ Internal.htmlClass "focusable"
1843 , Element.width (Element.px 14)
1844 , Element.height (Element.px 14)
1852 Element.rgb (59 / 255) (153 / 255) (252 / 255)
1855 Element.rgb (211 / 255) (211 / 255) (211 / 255)
1862 Element.rgba (238 / 255) (238 / 255) (238 / 255) 0
1865 Element.rgb (238 / 255) (238 / 255) (238 / 255)
1867 , Background.color <|
1869 Element.rgb (59 / 255) (153 / 255) (252 / 255)
1882 [ Border.color white
1883 , Element.height (Element.px 6)
1884 , Element.width (Element.px 9)
1885 , 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