-
Notifications
You must be signed in to change notification settings - Fork 1.3k
docs: Add concepts page #9099
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
base: main
Are you sure you want to change the base?
docs: Add concepts page #9099
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,156 @@ | ||||||
| import {Layout} from '../../src/Layout'; | ||||||
| export default Layout; | ||||||
|
|
||||||
| export const section = 'Guides'; | ||||||
| export const description = 'Learn about Accessibility, Internationalization, and Interactions in React Aria'; | ||||||
|
|
||||||
| # Concepts | ||||||
|
|
||||||
| <PageDescription>React Aria is built around three core principles: **Accessibility**, **Internationalization**, and **Interactions**. Together, these ensure that every component you build works for everyone, everywhere, and on every device.</PageDescription> | ||||||
|
|
||||||
| ## Accessibility | ||||||
|
|
||||||
| Accessible applications are usable by everyone, including people with disabilities. Accessibility benefits all users — not just those using assistive technologies — by improving efficiency, consistency, and usability. | ||||||
|
|
||||||
| React Aria provides built-in support for screen readers and keyboard navigation, following the [WAI-ARIA](https://www.w3.org/TR/wai-aria-1.2/) and [ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/) guidelines. It supplies the correct semantics via ARIA roles and attributes, handles keyboard and pointer events, manages focus, and provides screen reader announcements. React Aria components are tested across a wide variety of devices, browsers, and screen readers. | ||||||
|
|
||||||
| You’re responsible for providing meaningful labels and ensuring your visual design supports all users. This includes designing with sufficient [color contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast) and [hit target sizes](https://www.w3.org/WAI/WCAG22/Understanding/target-size-enhanced), including visible [focus rings](https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance), respecting [motion preferences](https://www.w3.org/WAI/WCAG21/Understanding/animation-from-interactions), and more. The [WCAG guidelines](https://www.w3.org/WAI/WCAG22/Understanding/) are a good resource to reference when designing and building components with React Aria. | ||||||
|
|
||||||
| ### Labeling | ||||||
|
|
||||||
| Most components should have a visible label, which is usually provided by rendering a `<Label>` element within it. This is associated with the component automatically. | ||||||
|
|
||||||
| ```tsx | ||||||
| import {TextField, Label, Input} from 'react-aria-components'; | ||||||
|
|
||||||
| <TextField> | ||||||
| {/*- begin highlight -*/} | ||||||
| <Label>First name</Label> | ||||||
| {/*- end highlight -*/} | ||||||
| <Input /> | ||||||
| </TextField> | ||||||
| ``` | ||||||
|
|
||||||
| When a component doesn't have a visible label, it must have an [aria-label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-label) or [aria-labelledby](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-labelledby) prop to provide an accessible name. | ||||||
|
|
||||||
| ```tsx | ||||||
| import {ProgressBar} from 'react-aria-components'; | ||||||
|
|
||||||
| <ProgressBar | ||||||
| /*- begin highlight -*/ | ||||||
| aria-label="Processing" /> | ||||||
| /*- end highlight -*/ | ||||||
| ``` | ||||||
|
|
||||||
| ### Supported screen readers | ||||||
|
|
||||||
| React Aria is tested across a variety of devices, browsers, and screen readers. | ||||||
|
|
||||||
| * [VoiceOver on macOS](https://www.apple.com/accessibility/mac/vision/) in Safari and Chrome | ||||||
| * [JAWS](https://www.freedomscientific.com/products/software/jaws/) on Windows in Firefox and Chrome | ||||||
| * [NVDA](https://www.nvaccess.org) on Windows in Firefox and Chrome | ||||||
| * [VoiceOver on iOS](https://www.apple.com/accessibility/iphone/vision/) | ||||||
| * [TalkBack](https://www.android.com/accessibility/) on Android in Chrome | ||||||
|
|
||||||
| ### Automated testing | ||||||
|
|
||||||
| Automated accessibility testing tools sometimes catch false positives in React Aria. These are documented in our [wiki](https://github.com/adobe/react-spectrum/wiki/Known-accessibility-false-positives). Use the rules below to ignore these issues in your own testing tools, such as in the [Storybook test runner](https://storybook.js.org/docs/7.1/react/writing-tests/accessibility-testing#a11y-config-with-the-test-runner) or [Storybook a11y addon](https://storybook.js.org/docs/7.1/react/writing-tests/accessibility-testing#global-a11y-configuration). | ||||||
|
||||||
| Automated accessibility testing tools sometimes catch false positives in React Aria. These are documented in our [wiki](https://github.com/adobe/react-spectrum/wiki/Known-accessibility-false-positives). Use the rules below to ignore these issues in your own testing tools, such as in the [Storybook test runner](https://storybook.js.org/docs/7.1/react/writing-tests/accessibility-testing#a11y-config-with-the-test-runner) or [Storybook a11y addon](https://storybook.js.org/docs/7.1/react/writing-tests/accessibility-testing#global-a11y-configuration). | |
| Automated accessibility testing tools sometimes catch false positives in React Aria. These are documented in our [wiki](https://github.com/adobe/react-spectrum/wiki/Known-accessibility-false-positives). Use the rules below to ignore these issues in your own testing tools, such as in the [Storybook test runner](https://storybook.js.org/docs/writing-tests/integrations/test-runner) or [Storybook a11y addon](https://storybook.js.org/addons/@storybook/addon-a11y). |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still want to highlight this one? #8868
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess not? Does it affect any of our other components?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know of any others and i didn't find anything in a quick search
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a less harsh intro to this paragraph, such as "While we can handle a lot, there are still steps you must take to complete an accessible experience..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe a slight change to how the paragraphs are introduced, like
Added this option because I think this is the flow I think you're going for, but it took reading a few sections to understand that. I'd love it if we knew in the first paragraph so that I know to keep an eye out for what's expected of me.
So even if you don't change how the paragraphs are introduced, maybe a sentence at the top saying, "This page will cover what we do as well as what is expected of you for each concept" (needs work, but general gist)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to keep it concise without a lot of extra fluff. And yes, that's what I was going for: covering what we do, and what you're supposed to handle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, lets just tell people that upfront in the intro paragraph so they know what too look out for