Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building Accessible Components
Search
Ari Rizzitano
September 24, 2017
Programming
1
570
Building Accessible Components
Originally presented at React Boston on September 24, 2017
Ari Rizzitano
September 24, 2017
Tweet
Share
More Decks by Ari Rizzitano
See All by Ari Rizzitano
The Future of Frontend Development in Open edX
arizzitano
1
270
What the -dux?
arizzitano
0
240
Rock 'em Socket.IO Bots
arizzitano
1
750
Other Decks in Programming
See All in Programming
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
510
AI巻き込み型コードレビューのススメ
nealle
0
130
CSC307 Lecture 05
javiergs
PRO
0
500
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
340
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
CSC307 Lecture 02
javiergs
PRO
1
770
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
930
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
650
CSC307 Lecture 08
javiergs
PRO
0
670
SourceGeneratorのススメ
htkym
0
190
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.9k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Side Projects
sachag
455
43k
A Soul's Torment
seathinner
5
2.2k
How to Talk to Developers About Accessibility
jct
2
130
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Typedesign – Prime Four
hannesfritz
42
2.9k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
51
Transcript
Building Accessible Components Ari Rizzitano, edX React Boston September 24,
2017
Hello Ari Rizzitano @arizzitano frontend team lead High quality education
for all We’re hiring!
None
Accessibility 101 React Best Practices Developer Toolkit
Accessibility 101
The degree to which a product, device, or environment is
available to a person.
Why?
The web
The web NOT ALWAYS ACCESSIBLE
Assistive technology helps bridge the gap
Input
Input
Output
Output text
Keyboard in, text out. But how?
Web standards Let’s follow them as closely as we follow
new ECMAScript proposals
Web Content Accessibility Guidelines (WCAG) 2.0 is our accessibility rulebook.
WAI-ARIA Authoring Practices is our cookbook.
For every generic component you build, check the WAI-ARIA authoring
practices. Chances are, there’s a section there for your use case.
Get familiar with aria attrs
Learn about roles and what they mean for document semantics.
Keyboard events: which keys should do what and where?
Master tab nav & tabIndex
Color contrast Color contrast Color contrast Color contrast Color contrast
Color contrast Color contrast Color contrast
1. Keyboard in 2. Text out 3. Follow standards 4.
Profit.
React Best Practices
Genericize as much accessible functionality as possible. A component library
is a great way to do this.
Best practice for focus is best practice for perf
An example Todos Learn about WCAG Your text here…
Change the state Todos Learn about WCAG Profile this app
Entire List Rerenders Todos Learn about WCAG Profile this app
Your text here…
Focus Lost! Todos Learn about WCAG Profile this app Your
text here…
Only render what you need Todos Learn about WCAG Profile
this app Your text here…
For programmatic focus management, 1. use refs 2. use componentDidUpdate
Trap focus when appropriate
On route changes, inform users of a change of context.
react-document-title works well here
Enforce best practices
Full Name Enter your name… Enter your full legal name
as it appears on your government ID. This field is required. Required Props
Enforce best practices
Use HOCs to reuse behavior & markup e.g. for different
input types
Developer Toolkit
audits code review manual acceptance testing unit tests linting Accessibility
Testing
Accessibility linting
eslint-plugin-jsx-a11y
Solid unit tests (this one is just common sense)
Immediate linter feedback helps devs internalize best practices
Dogfood! Test and interact with your app the way people
with disabilities might use it.
Navigate using only the keyboard
Side benefit: keyboard nav is faster than mouse (also you
feel like a hacker)
Use a screen reader! It’s as easy as ⌘-F5 On
a Mac. On Windows, use NVDA or JAWS. On Linux, use Orca.
Browser extensions Explore the accessibility tree, check color contrast, audit
your code while working on it
Accessibility audit automation
Recommendations: react-axe or Google Lighthouse (but there are plenty of
other good ones out there)
React’s toolchain facilitates building accessible applications.
Accessibility is easy to implement up front, but harder to
retrofit. Kind of like tests.
Web accessibility is built on best practices that benefit everyone
Thank you. @arizzitano