Skip to content

Commit a2b6956

Browse files
authored
docs: deprecated Hint (#50)
1 parent efb0e77 commit a2b6956

File tree

5 files changed

+28
-54
lines changed

5 files changed

+28
-54
lines changed

README.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ note: The full documentation can be found on the [pmndrs website](https://docs.p
2929
First, place the A11yAnnouncer component next to the R3F Canvas component. this componant is critical since it manage some screen-reader features.
3030

3131
```jsx
32-
import { Canvas } from '@react-three/fiber'
33-
import { A11yAnnouncer } from '@react-three/a11y'
32+
import { Canvas } from '@react-three/fiber';
33+
import { A11yAnnouncer } from '@react-three/a11y';
3434

3535
function App() {
3636
return (
3737
<>
3838
<Canvas />
3939
<A11yAnnouncer />
4040
</>
41-
)
41+
);
4242
}
4343
```
4444

@@ -141,10 +141,8 @@ Uses the `pointer` cursor. Special attributes: `href`.
141141

142142
This role is meant to emulate the behaviour of a regular html link. It should be used in combination with something that will trigger navigation on click.
143143

144-
<Hint>
145-
- Don't forget to provide the href attribute as he is required for screen readers to read it
146-
correctly ! - It will have no effect on the navigation, it's just used as information
147-
</Hint>
144+
> [!NOTE]
145+
> Don't forget to provide the href attribute as he is required for screen readers to read it correctly ! - It will have no effect on the navigation, it's just used as information
148146
149147
[Read more about role link](https://docs.pmnd.rs/a11y/roles/link)
150148

@@ -183,16 +181,9 @@ Use a custom tabindex with for your A11y components by providing a number to the
183181
<A11y tabIndex={-1} ... />
184182
```
185183

186-
⚠⚠⚠
187-
<br />
188-
Avoid using tabindex values greater than 0. Doing so makes it difficult for people who rely on
189-
assistive technology to navigate and operate page content. Instead, write the document with the
190-
elements in a logical sequence.
191-
<br />
192-
More about the use of tabIndex on{' '}
193-
<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex">
194-
developer.mozilla.org
195-
</a>
184+
> [!CAUTION]
185+
> Avoid using `tabindex` values greater than 0. Doing so makes it difficult for people who rely on assistive technology to navigate and operate page content.
186+
> Instead, write the document with the elements in a logical sequence. More about the use of tabIndex on [developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex)
196187
197188
### Author:
198189

docs/introduction.mdx

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ npm install @react-three/a11y
3030
First, place the A11yAnnouncer component next to the R3F Canvas component. This component is critical since it manage some screen-reader features.
3131

3232
```jsx
33-
import { Canvas } from '@react-three/fiber'
34-
import { A11yAnnouncer } from '@react-three/a11y'
33+
import { Canvas } from '@react-three/fiber';
34+
import { A11yAnnouncer } from '@react-three/a11y';
3535

3636
function App() {
3737
return (
3838
<>
3939
<Canvas />
4040
<A11yAnnouncer />
4141
</>
42-
)
42+
);
4343
}
4444
```
4545

@@ -142,10 +142,8 @@ Uses the `pointer` cursor. Special attributes: `href`.
142142

143143
This role is meant to emulate the behaviour of a regular html link. It should be used in combination with something that will trigger navigation on click.
144144

145-
<Hint>
146-
- Don't forget to provide the href attribute as it is required for screen readers to read it
147-
correctly! - It will have no effect on the navigation, it's just used as information
148-
</Hint>
145+
> [!NOTE]
146+
> Don't forget to provide the href attribute as it is required for screen readers to read it correctly! - It will have no effect on the navigation, it's just used as information
149147
150148
[Read more about role link](/a11y/roles/link)
151149

@@ -184,15 +182,6 @@ Use a custom tabindex with for your A11y components by providing a number to the
184182
<A11y tabIndex={-1} ... />
185183
```
186184

187-
<Hint>
188-
⚠⚠⚠
189-
<br />
190-
Avoid using tabindex values greater than 0. Doing so makes it difficult for people who rely on
191-
assistive technology to navigate and operate page content. Instead, write the document with the
192-
elements in a logical sequence.
193-
<br />
194-
More about the use of tabIndex on{' '}
195-
<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex">
196-
developer.mozilla.org
197-
</a>
198-
</Hint>
185+
> [!CAUTION]
186+
> Avoid using `tabindex` values greater than 0. Doing so makes it difficult for people who rely on assistive technology to navigate and operate page content.
187+
> Instead, write the document with the elements in a logical sequence. More about the use of tabIndex on [developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex)

docs/roles/content.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ That's it !
2727
Now if you inspect the dom of your app, you will see that a `<p>` tag has been added with your text inside.
2828
That way, user with a screenreader will be able to read that text too.
2929

30-
<Hint>
31-
For people using screen readers it will also sync some kind of focus indicator natively where your
32-
text is so people so screen readers users will know where they're currently in your page.
33-
</Hint>
30+
> [!NOTE]
31+
> For people using screen readers it will also sync some kind of focus indicator natively where your text is so people so screen readers users will know where they're currently in your page.
3432
3533
This role can also be used to serve as a step for a user to navigate your site using Tab for instance.
3634
For that you would need to add the tabIndex prop and the focusCall prop like so.

docs/roles/link.mdx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Since it's meant to emulate the behaviour of a regular html link. It should be u
1515
role="link"
1616
href="/page"
1717
actionCall={() => {
18-
router.push(`/page`)
18+
router.push(`/page`);
1919
}}
2020
>
2121
<Some3DComponent />
@@ -30,7 +30,7 @@ You can also play with it in [this demo](https://n4rzi.csb.app)
3030

3131
```jsx
3232
function Some3DComponent() {
33-
const a11y = useA11y()
33+
const a11y = useA11y();
3434
return (
3535
<mesh>
3636
<boxBufferGeometry />
@@ -41,12 +41,10 @@ function Some3DComponent() {
4141
emissive={a11y.focus ? '#cc4444' : a11y.hover ? '#339922' : '#003399'}
4242
/>
4343
</mesh>
44-
)
44+
);
4545
}
4646
```
4747

48-
<Hint>
49-
Don't forget to provide the href attribute as he is required for screen readers to read it
50-
correctly !<br />
51-
It will have no effect on the navigation, it's just used as information
52-
</Hint>
48+
> [!IMPORTANT]
49+
> Don't forget to provide the `href` attribute as he is required for screen readers to read it correctly!
50+
> It will have no effect on the navigation, it's just used as information

docs/roles/togglebutton.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,16 @@ It is also actionnable by user using a screen reader.
2727

2828
Using it like this makes it focusable to all kind of users.
2929

30-
<Hint>
31-
You might have noticed the startPressed prop. Depending on your need, you might want to have your
32-
button starting in a pressed state. This is what this prop is for.
33-
</Hint>
30+
> [!NOTE]
31+
> You might have noticed the startPressed prop. Depending on your need, you might want to have your button starting in a pressed state. This is what this prop is for.
3432
3533
You should also use the useA11y() hook within the encapsulated components to adjust the rendering on hover and focus and pressed state. Doing so greatly improve the accessibility of your page.
3634
Take a look at this code sample to see how to use it.
3735
You can also play with it in [this demo](https://n4rzi.csb.app)
3836

3937
```jsx
4038
function Some3DComponent() {
41-
const a11y = useA11y() // access pressed, hover and focus
39+
const a11y = useA11y(); // access pressed, hover and focus
4240
return (
4341
<mesh>
4442
<boxBufferGeometry />
@@ -49,7 +47,7 @@ function Some3DComponent() {
4947
emissive={a11y.focus ? '#cc4444' : a11y.hover ? '#339922' : '#003399'}
5048
/>
5149
</mesh>
52-
)
50+
);
5351
}
5452
```
5553

0 commit comments

Comments
 (0)