Error Alert Examples & Color Contrast Gotcha

Correct: Error Alert with Good Contrast

Gotcha: Error Alert with Poor Contrast

Key Classes for Error Alert (Good Contrast):

Addressing the "Gotcha":

The "Gotcha" is poor color contrast. The second example above intentionally uses text-red-200 (a very light red) on bg-red-100 (a light red background). This results in text that is difficult to read. To avoid this, always choose a text color that has significant contrast with the background color. For light backgrounds like bg-red-100 , use darker text colors like text-red-700 or text-red-800 . Tools like browser developer tools or online contrast checkers can help verify accessibility.