-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Alert role
#132
Comments
I am not familiar with the CallOut component. It does not seem to be a common pattern in other component libraries. Would it be possible to just adjust the role for info, success, or warning if necessary instead of creating a new component? |
In my mind, I'm differentiating Alert and Callout like this:
The Alert/Callout split was also inspired by the following design systems:
I initially went with It is possible to reuse Alert and let the consumers specify the Also, if we make We have a similar situation with the In summary, I think of |
Description
The
Alert
component always has thealert
role:ui/src/alert/alert.tsx
Line 36 in 46150e7
However, the
alert
role is quite disruptive to non-sighted users. The role is equivalent to settingaria-live="assertive"
, which interrupts the user's current task and announces the message immediately. For this reason, the role should only be used for time-sensitive messages, typically error messages.I'd propose that we change the component's
role
as follows:role
isalert
if the variant isdanger
role
isstatus
if the variant isinfo
,success
, orwarning
Additionally, we should consider creating a separate component for callout boxes:
Screenshots
We're using
Alert
for those messages (to achieve consistent styles), but I think the content of those boxes should be read as part of the page content, rather than as a notification / alert.The new callout component can have the same set of variants that Alert has, but renders its content in a plain
div
, without any roles.References
The text was updated successfully, but these errors were encountered: