Keyboard Navigation Basics
Not everyone uses a mouse. Many people navigate the web entirely with a keyboard, using Tab to move between interactive elements and Enter or Space to activate them. For keyboard navigation to work, every interactive element needs to be focusable and have a visible focus indicator. Custom components built with divs and spans often break this because browsers don't know they're supposed to be interactive. Adding tabindex and keyboard event handlers can fix it, but using native elements like button and a is always better.