[Feature Request] Add visual variants for Alert container backgrounds and borders #6684
focus0802
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Feature description
The v3 Alert component already supports semantic
statusvalues such asdefault,accent,success,warning, anddanger.However, the Alert container itself still uses the same surface treatment. In the current styles, the base alert uses
bg-surfaceandshadow-surface, while the status modifiers mainly change the indicator and title colors.This makes Alert easy to miss when it is placed inside a white or surface-colored parent container. The alert can visually blend into the surrounding content even when the message is important.
Proposal
Add a visual
variantprop for Alert container presentation, while keepingstatusfor semantic meaning.For example:
Possible variants could include:
plainordefault: current behaviorsoft: tinted background based on the current statusbordered: status-colored border with a subtle backgroundsolid: stronger status-colored background for high-emphasis alertsExpected behavior
Changing
statusshould continue to control the semantic color. Changingvariantshould control how visually prominent the Alert container is.For example:
status="success" variant="soft"could use a subtle success background and borderstatus="warning" variant="soft"could use a subtle warning background and borderstatus="danger" variant="bordered"could use a danger border with a light danger-tinted backgroundWhy this would help
This would make Alert easier to distinguish from same-color page surfaces, especially in dashboards, forms, and settings pages where alerts often appear inside white cards or white content containers.
It would also reduce the need for every app to manually customize
classNamejust to make alerts visually stand out.Related context
This is not a request to replace the existing
statusAPI. The request is for an additional visual presentation option that can work together withstatus.All reactions