Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Building Accessible Components
Search
Ari Rizzitano
September 24, 2017
Programming
610
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Building Accessible Components
Originally presented at React Boston on September 24, 2017
Ari Rizzitano
September 24, 2017
More Decks by Ari Rizzitano
See All by Ari Rizzitano
The Future of Frontend Development in Open edX
arizzitano
1
290
What the -dux?
arizzitano
0
260
Rock 'em Socket.IO Bots
arizzitano
1
780
Other Decks in Programming
See All in Programming
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
340
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
990
AWSに止められる覚悟してますか?
morizo_1984
2
530
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
ChromeでローカルLLM
ryu1013
0
140
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
260
ジョジョの世界をXRで再現する
mofurune
0
160
残高管理から台帳サービスへの進化
artoy
1
200
The Rails Doctrine Decade
koic
2
570
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
170
Event is what happens
moro
2
670
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Marketing to machines
jonoalderson
1
5.9k
My Coaching Mixtape
mlcsv
0
350
The Cost Of JavaScript in 2023
addyosmani
55
10k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
The agentic SEO stack - context over prompts
schlessera
0
970
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
520
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
First, design no harm
axbom
PRO
2
1.3k
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