TooltipLoading saved progress…

Tooltip

A tooltip is a short hint that appears while its trigger is hovered or focused. Build the React version with one boolean that controls the bubble and its accessible relationship to the button.

Signature

Implement the default App component in App.tsx; it receives no props and renders the complete trigger and tooltip.

Examples

  • Hovering Hover me displays Saved to your library; moving the pointer away hides it.
  • Focusing the button displays the same bubble; blurring it hides the bubble.
  • While visible, the button has aria-describedby="library-tip" and the bubble has id="library-tip" with role="tooltip".

Notes

  • Use one state value. Track visibility with useState(false).
  • Support pointer and keyboard input. Pair onMouseEnter/onMouseLeave with onFocus/onBlur.
  • Render conditionally. Mount the bubble only while show is true.
  • Connect the description. Add aria-describedby only while its matching tooltip exists.
  • Focus on behavior. Persistent styling lives in styles.css.
WE’RE LISTENING

Help make UIReady better

Found a bug or have an idea? Tell us about it.

Up to 3 files · 5 MiB each · JPG, PNG, WebP, MP4, WebM, MP3, M4A or WAV