Skip to content

Commit 19b7d8a

Browse files
Dominic Cjpdriver
andauthored
Minor doc improvements (#78)
* minor doc improvements: - format string values more clearly - update list of values for accessibilityRole * mirror formatting updates on new rules Co-authored-by: JP <[email protected]>
1 parent b36a34a commit 19b7d8a

11 files changed

+87
-71
lines changed

docs/rules/has-accessibility-props.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ The accessibilityRole props tells VoiceOver on iOS what kind of element the user
66

77
Touchable components are one of:
88

9-
- TouchableOpacity
10-
- TouchableHighlight
11-
- TouchableWithoutFeedback
12-
- TouchableNativeFeedback
13-
- TouchableBounce
14-
- Touchable (from [react-native-platform-touchable](https://github.com/react-community/react-native-platform-touchable))
9+
- `TouchableOpacity`
10+
- `TouchableHighlight`
11+
- `TouchableWithoutFeedback`
12+
- `TouchableNativeFeedback`
13+
- `TouchableBounce`
14+
- `Touchable` (from [react-native-platform-touchable](https://github.com/react-community/react-native-platform-touchable))
1515

1616
### References
1717

18-
1. https://facebook.github.io/react-native/docs/accessibility.html#accessibilityrole-ios-android
19-
2. https://facebook.github.io/react-native/docs/accessibility.html#accessibilitytraits-ios
20-
3. https://facebook.github.io/react-native/docs/accessibility.html#accessibilitycomponenttype-android
18+
1. https://facebook.github.io/react-native/docs/accessibility.html#accessibilityrole-ios-android
19+
2. https://facebook.github.io/react-native/docs/accessibility.html#accessibilitytraits-ios
20+
3. https://facebook.github.io/react-native/docs/accessibility.html#accessibilitycomponenttype-android
2121

2222
## Rule details
2323

docs/rules/has-valid-accessibility-actions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ Depending on the action type, the action should contain the following fields:-
1313

1414
NAME|TYPE|REQUIRED
1515
-|-|-
16-
name|string|**Yes**
17-
label|string|Only required for Custom actions
16+
`name`|string|**Yes**
17+
`label`|string|Only required for Custom actions
1818

1919
### Standard Actions
2020

2121
Standard Actions must have a `name` field matching one of:-
2222

2323
NAME|PLATFORM SUPPORT
2424
-|-
25-
magicTap|iOS only
26-
escape|iOS only
27-
activate|both iOS & Android
28-
increment|both iOS & Android
29-
decrement|both iOS & Android
30-
longpress|Android only
25+
`"magicTap"`|iOS only
26+
`"escape"`|iOS only
27+
`"activate"`|both iOS & Android
28+
`"increment"`|both iOS & Android
29+
`"decrement"`|both iOS & Android
30+
`"longpress"`|Android only
3131

3232
Providing a `label` for a Standard Action is optional.
3333

docs/rules/has-valid-accessibility-component-type.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ The accessibilityComponentType property is essentially the android version of [a
44

55
Values may be one of the following:
66

7-
- none
8-
- button
9-
- radiobutton_checked
10-
- radiobutton_unchecked
7+
- `"none"`
8+
- `"button"`
9+
- `"radiobutton_checked"`
10+
- `"radiobutton_unchecked"`
1111

1212
### References
1313

14-
1. https://facebook.github.io/react-native/docs/accessibility.html#accessibilitycomponenttype-android
14+
1. https://facebook.github.io/react-native/docs/accessibility.html#accessibilitycomponenttype-android
1515

1616
## Rule details
1717

docs/rules/has-valid-accessibility-live-region.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
On android devices, when components dynamically change, we want TalkBack to alert the end user. This is made possible by the `accessibilityLiveRegion` property. It can be set to the following values:
44

5-
- none: Accessibility services should not announce changes to this view.
6-
- polite: Accessibility services should announce changes to this view.
7-
- assertive: Accessibility services should interrupt ongoing speech to immediately announce changes to this view.
5+
- `"none"`: Accessibility services should not announce changes to this view.
6+
- `"polite"`: Accessibility services should announce changes to this view.
7+
- `"assertive"`: Accessibility services should interrupt ongoing speech to immediately announce changes to this view.
88

99
### References
1010

11-
1. https://facebook.github.io/react-native/docs/accessibility.html#accessibilityliveregion-android
11+
1. https://facebook.github.io/react-native/docs/accessibility.html#accessibilityliveregion-android
1212

1313
## Rule details
1414

docs/rules/has-valid-accessibility-role.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,33 @@ The accessibilityRole property is used to tell Talkback or Voiceover the role of
66

77
## Values may be one of the following
88

9-
- `adjustable`: Used when an element can be "adjusted" (e.g. a slider).
10-
- `button`: Used when the element should be treated as a button.
11-
- `header`: Used when an element acts as a header for a content section (e.g. the title of a navigation bar).
12-
- `image`: Used when the element should be treated as an image. Can be combined with button or link, for example.
13-
- `imagebutton`: Used when the element should be treated as a button and is also an image.
14-
- `keyboardkey`: Used when the element acts as a keyboard key.
15-
- `link`: Used when the element should be treated as a link.
16-
- `none`: Used when the element has no role.
17-
- `search`: Used when the text field element should also be treated as a search field.
18-
- `summary`: Used when an element can be used to provide a quick summary of current conditions in the app when the app first launches.
19-
- `text`: Used when the element should be treated as static text that cannot change.
9+
- `"adjustable"`: Used when an element can be "adjusted" (e.g. a slider).
10+
- `"alert"`: Used when an element contains important text to be presented to the user.
11+
- `"button"`: Used when the element should be treated as a button.
12+
- `"checkbox"`: Used when an element represents a checkbox which can be checked, unchecked, or have mixed checked state.
13+
- `"combobox"`: Used when an element represents a combo box, which allows the user to select among several choices.
14+
- `"header"`: Used when an element acts as a header for a content section (e.g. the title of a navigation bar).
15+
- `"image"`: Used when the element should be treated as an image. Can be combined with button or link, for example.
16+
- `"imagebutton"`: Used when the element should be treated as a button and is also an image.
17+
- `"keyboardkey"`: Used when the element acts as a keyboard key.
18+
- `"link"`: Used when the element should be treated as a link.
19+
- `"menu"`: Used when the component is a menu of choices.
20+
- `"menubar"`: Used when a component is a container of multiple menus.
21+
- `"menuitem"`: Used to represent an item within a menu.
22+
- `"none"`: Used when the element has no role.
23+
- `"progressbar"`: Used to represent a component which indicates progress of a task.
24+
- `"radio"`: Used to represent a radio button.
25+
- `"radiogroup"`: Used to represent a group of radio buttons.
26+
- `"scrollbar"`: Used to represent a scroll bar.
27+
- `"search"`: Used when the text field element should also be treated as a search field.
28+
- `"spinbutton"`: Used to represent a button which opens a list of choices.
29+
- `"summary"`: Used when an element can be used to provide a quick summary of current conditions in the app when the app first launches.
30+
- `"switch"`: Used to represent a switch which can be turned on and off.
31+
- `"tab"`: Used to represent a tab.
32+
- `"tablist"`: Used to represent a list of tabs.
33+
- `"text"`: Used when the element should be treated as static text that cannot change.
34+
- `"timer"`: Used to represent a timer.
35+
- `"toolbar"`: Used to represent a tool bar (a container of action buttons or components).
2036

2137
### References
2238

docs/rules/has-valid-accessibility-state.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Describes the current state of a component to the user of an assistive technolog
66

77
NAME|TYPE|REQUIRED
88
-|-|-
9-
disabled|boolean|No
10-
selecte|boolean|No
11-
checked|boolean or 'mixed'|No
12-
busy|boolean|No
13-
expanded|boolean|No
9+
`disabled`|boolean|No
10+
`selected`|boolean|No
11+
`checked`|boolean or 'mixed'|No
12+
`busy`|boolean|No
13+
`expanded`|boolean|No
1414

1515
### References
1616

docs/rules/has-valid-accessibility-states.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ The accessibilityStates property is used to tell Talkback or Voiceover the state
66

77
## This property takes on an Array containing one, both, or neither of the following values
88

9-
- `selected`: Used when the element is in a selected state. For example, a button is selected.
10-
- `disabled`: Used when the element is disabled and cannot be interacted with
9+
- `"selected"`: Used when the element is in a selected state. For example, a button is selected.
10+
- `"disabled"`: Used when the element is disabled and cannot be interacted with
1111

1212
### References
1313

docs/rules/has-valid-accessibility-traits.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ The accessibilityTraits property is used to tell a person using VoiceOver what k
66

77
## Values may be one of the following
88

9-
- none
10-
- button
11-
- link
12-
- header
13-
- search
14-
- image
15-
- selected
16-
- plays
17-
- key
18-
- text
19-
- summary
20-
- disabled
21-
- frequentUpdates
22-
- startsMedia
23-
- adjustable
24-
- allowsDirectInteraction
25-
- pageTurn
9+
- `"none"`
10+
- `"button"`
11+
- `"link"`
12+
- `"header"`
13+
- `"search"`
14+
- `"image"`
15+
- `"selected"`
16+
- `"plays"`
17+
- `"key"`
18+
- `"text"`
19+
- `"summary"`
20+
- `"disabled"`
21+
- `"frequentUpdates"`
22+
- `"startsMedia"`
23+
- `"adjustable"`
24+
- `"allowsDirectInteraction"`
25+
- `"pageTurn"`
2626

2727
### References
2828

docs/rules/has-valid-accessibility-value.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Represents the current value of a component.
66

77
NAME|DESCRIPTION|TYPE|REQUIRED
88
-|-|-|-
9-
min|The minimum value of this component's range.|integer|Required if `now` is set.
10-
max|The maximum value of this component's range.|integer|Required if `now` is set.
11-
now|The current value of this component's range.|integer|No
9+
`min`|The minimum value of this component's range.|integer|Required if `now` is set.
10+
`max`|The maximum value of this component's range.|integer|Required if `now` is set.
11+
`now`|The current value of this component's range.|integer|No
1212

1313
NAME|DESCRIPTION|TYPE|REQUIRED
1414
-|-|-|-
15-
text|A textual description of this component's value.|string|No
15+
`text`|A textual description of this component's value.|string|No
1616

1717

1818
### References

docs/rules/has-valid-important-for-accessibility.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
If there are two (or more) overlapping UI components with the same parent, default accessibility focus can have unpredictable behavior. The `importantForAccessibility` property will resolve this by controlling if a view fires accessibility events and if it is reported to accessibility services. It can be set to:
44

5-
- auto
6-
- yes
7-
- no
8-
- no-hide-descendants (this will force accessibility services to ignore the component and all of its children).
5+
- `"auto"`
6+
- `"yes"`
7+
- `"no"`
8+
- `"no-hide-descendants"` (this will force accessibility services to ignore the component and all of its children).
99

1010
### References
1111

12-
1. https://facebook.github.io/react-native/docs/accessibility.html#importantforaccessibility-android
12+
1. https://facebook.github.io/react-native/docs/accessibility.html#importantforaccessibility-android
1313

1414
## Rule details
1515

0 commit comments

Comments
 (0)