Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Update accessibility.mdx #1965

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions docs/src/pages/guides/accessibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ Vestibular dysfunction, a balance disorder of the inner ear, is surprisingly com
/>
</p>

Combine `skipAnimation` with [prefers-reduced-motion](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion) to gracefully disable or reduce the motion of your animations. [react-reduce-motion](https://github.com/infiniteluke/react-reduce-motion) is a cross platform hook that exposes this OS level setting, enabling you to disable or lessen your animations for users that want to opt out.
Combine `skipAnimation` with [prefers-reduced-motion](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion) to gracefully disable or reduce the motion of your animations. `useReducedMotion` enables you to disable or reduce your animations for users that want to opt out.

To disable animations using this hook you can use react-spring's `skipAnimation` global:

```jsx
import { useReducedMotion } from 'react-reduce-motion'
import { Globals } from 'react-spring'
import { Globals, useReducedMotion } from 'react-spring'

const MyApp = () => {
const prefersReducedMotion = useReducedMotion()
Expand All @@ -36,7 +35,7 @@ const MyApp = () => {
Animations can also be disable on a case by case basis using the `immediate` property.

```jsx
import { useReducedMotion } from 'react-reduce-motion'
import { useReducedMotion } from 'react-spring'

const MyComponent = () => {
const prefersReducedMotion = useReducedMotion()
Expand All @@ -48,7 +47,7 @@ const MyComponent = () => {
Finally, animations can be lessened by applying your own heuristic.

```jsx
import { useReducedMotion } from 'react-reduce-motion'
import { useReducedMotion } from 'react-spring'

const MyComponent = () => {
const prefersReducedMotion = useReducedMotion()
Expand All @@ -58,5 +57,3 @@ const MyComponent = () => {
// ...
}
```

Check out [react-reduce-motion](https://github.com/infiniteluke/react-reduce-motion) to learn more.