This project is meant to teach software engineers how to create accessible tooltips in React. It includes good examples and bad examples. View the demo app here.
This project was bootstrapped with Create React App.
- There are many different ways that tooltips can be used! Be sure to think about your use case before implementing a solution.
- Don't use the
title
attribute for tooltips. - In general, tooltips should contain short, non-essential, supplemental content.
- Short tooltips may appear on hover/focus or on click/keypress. That feels like a design preference decision.
- In general, long tooltips should be avoided. If you do use a tooltip with lengthy content, it may be a good idea to treat it like a modal.
- If the tooltip has interactive content, it should be treated like a modal, regardless of length.
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