git.iko.soy/typeable/elm-ui
on master help sign in
add note about `Region.description`
commit658464f2156f7be8fb9b1a5db4af2ef5ee084aa8 authormdgriffith <mdgriffith@users.noreply.github.com> dateMon 25 May 2020, 18:58 (6 years ago) parent4d624f2
2 files changed+7−1
src/Element/Input.elm+2 src/Element/Region.elm+5−1
src/Element/Input.elm+2
@@ -330,6 +330,8 @@ The `onPress` handler will be fired either `onClick` or when the element is focu
330330 , label = text "My Button"
331331 }
332332
333+**Note** If you have an icon button but want it to be accessible, consider adding a [`Region.description`](Element-Region#description), which will describe the button to screen readers.
334+
333335-}
334336button :
335337 List (Attribute msg)
src/Element/Region.elm+5−1
@@ -101,7 +101,11 @@ announce =
101101 Internal.Describe LivePolite
102102
103103
104−{-| -}
104+{-| Adds an `aria-label`, which is used by accessibility software to identity otherwise unlabeled elements.
105+
106+A common use for this would be to label buttons that only have an icon.
107+
108+-}
105109description : String -> Attribute msg
106110description =
107111 Internal.Describe << Internal.Label