This project is meant to teach software engineers how to create accessible nested interactive content in React. It includes good examples and bad examples.
This project was bootstrapped with Create React App.
You can find the demo app hosted here: http://tylerhawkins.info/a11y-nested-interactive-content/build/
You can run the app locally by simply cloning the repo, running yarn install
, and then running yarn start
.
- Interactive content should not be nested.
- When re-creating a button element using a div element, you must remember to add a tabindex, a keypress handler, and the role="button" attribute.
- Lists of items should use proper semantic list elements.
- Interactive content needs adequate visible focus indicators.
- Contextual labels should be added to buttons to indicate which item in the list the button relates to.
- Accessible content can still look good!
- You can often take inaccessible content and improve it even without affecting the initial UI design.
In the project directory, you can run:
build
: Builds the appeject
: Ejects the app from using react-scriptsformat
: Formats the code using Prettierformat-watch
: Formats the code using Prettier in watch modestart
: Starts the app in development modetest
: Runs the tests in watch mode