Skip to content

Commit 849b9bf

Browse files
authored
Update README.md
1 parent 8c8eb11 commit 849b9bf

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,29 +82,34 @@ How you display the focus / hover information to the user is up to you! Just mak
8282

8383
## The role attribute
8484

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:
8787

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**.
9090
It's not meant to trigger anything on click or to be activable with the Keyboard.
91+
9192
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+
97100
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**.
100104
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+
102107
More on this role <a href="/#link"> below </a>
103108

104109
## Call function on focus
105110

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.
108113

109114
```jsx
110115
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
123128

124129
## Call function on click / keyboard Click
125130

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..
127132

128133
```jsx
129134
import { A11yAnnouncer, A11y } from "@react-three/a11y"
@@ -142,8 +147,8 @@ The A11y attribute actionCall will call the associated function each time this c
142147

143148
## Provide a description of the currenlty focused / hovered element
144149

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}`.
147152

148153
```jsx
149154
import { A11yAnnouncer, A11y } from "@react-three/a11y"

0 commit comments

Comments
 (0)