@@ -82,29 +82,34 @@ How you display the focus / hover information to the user is up to you! Just mak
82
82
83
83
## The role attribute
84
84
85
- Like in HTML, you can focus different kind of element and expect different things depending on what you're focusing.
86
- That's why the A11y component is divided in 3 categories.
85
+ Like in HTML, you can focus different kind of elements and expect different things depending on what you're focusing.
86
+ That's why the ` A11y ` component has 3 different use cases:
87
87
88
- - role="content" ( default )
89
- This role is meant to provide information to screen readers or to serve as a step for a user to navigate your site using Tab for instance .
88
+ - ` role="content" ` ( default )
89
+ This role is meant to ** provide information to screen readers** or to ** serve as a step for a user to navigate your site using Tab** .
90
90
It's not meant to trigger anything on click or to be activable with the Keyboard.
91
+
91
92
More on this role <a href =" /#content " > below </a >
92
- - role="button"
93
- This role is meant to emulate the behaviour of a button or a togglable button.
94
- It will display a cursor pointer when your cursor is over the linked 3D object.
95
- It will call a function on click but also on any kind of action that would trigger a focused button ( Enter, Double-Tap .. )
96
- It is also actionnable by user using a screen reader.
93
+
94
+ - ` role="button" `
95
+ This role is meant to ** emulate the behaviour of a button or a togglable button** .
96
+ It will display a pointer cursor when your cursor is hovering the linked 3D Object.
97
+ It will call a callback function on click but also on any kind of action that would trigger a focused button ( Enter, Double-Tap .. )
98
+ It is also actionable by a user using a screen reader.
99
+
97
100
More on this role <a href =" /#button " > below </a >
98
- - role="link"
99
- This role is meant to emulate the behaviour of a regular html link.
101
+
102
+ - ` role="link" `
103
+ This role is meant to ** emulate the behaviour of a regular HTML link** .
100
104
It should be used in combination with something that will trigger navigation on click.
101
- Just like the button one, it is accessible to all kind of user.
105
+ Just like the button, it is accessible to all kinds of users.
106
+
102
107
More on this role <a href =" /#link " > below </a >
103
108
104
109
## Call function on focus
105
110
106
- The A11y attribute focusCall will be called each time this component receive focus ( Usually through tab navigation )
107
- You can for instance use it in order to make sure the currently focused element is in view by adjusting it position or the camera position .
111
+ The ` focusCall ` prop of ` A11y ` will be called each time this component receive focus ( Usually through tab navigation ).
112
+ You can for instance use it in order to make sure the currently focused element is in view by adjusting its position or the moving the camera .
108
113
109
114
``` jsx
110
115
import { A11yAnnouncer , A11y } from " @react-three/a11y"
@@ -123,7 +128,7 @@ You can for instance use it in order to make sure the currently focused element
123
128
124
129
## Call function on click / keyboard Click
125
130
126
- The A11y attribute actionCall will call the associated function each time this component gets clicked / focused then keyboard activated etc..
131
+ The ` actionCall ` prop of ` A11y ` will be called each time this component gets clicked, focused, keyboard activated etc..
127
132
128
133
``` jsx
129
134
import { A11yAnnouncer , A11y } from " @react-three/a11y"
@@ -142,8 +147,8 @@ The A11y attribute actionCall will call the associated function each time this c
142
147
143
148
## Provide a description of the currenlty focused / hovered element
144
149
145
- Your A11y component will provide a description to the screen reader users on focus / hover as long as you provide it to the description attribute .
146
- Optionnaly , you can also show the description to the user when he hover it by setting showAltText={true}.
150
+ When using the ` description ` prop, the ` A11y ` component will provide a description to the screen reader users on focus/ hover.
151
+ Optionally , you can also show the description to the user on hover by setting ` showAltText={true} ` .
147
152
148
153
``` jsx
149
154
import { A11yAnnouncer , A11y } from " @react-three/a11y"
0 commit comments