Start with the right element
Native elements come with keyboard support, focus and screen reader semantics for free. Reach for ARIA only when no element fits.
Keyboard and focus
- Every interactive element is reachable with Tab and activates with Enter or Space.
- Focus is always visible: prefer
focus-visiblerings over removing outlines. - Dialogs trap focus while open and return it to the trigger when closed.
- Escape closes popovers, menus and dialogs.
- Tab order follows the visual order; avoid positive
tabindexvalues.
Give everything an accessible name
Icon-only buttons are the most common gap. A visible tooltip is not an accessible name — add aria-label or visually hidden text.
Color and contrast
Never use color alone to convey meaning: pair a red border with an error message and an icon.
Respect reduced motion
In Tailwind, prefix animations with motion-safe: so they only run for people who have not asked to reduce motion.