Alert Deprecated
Deprecated
Do not use it in new code. It stays documented to help migrate its remaining usages.
Use instead:
AlertNextfrommurray: It enforces the dismiss rules (only informative/success can be dismissed), uses declarative actions and iconAction props, and aligns with the Figma design.
Shows an important message inline, without interrupting what the member is doing.
partially-compliant
- Overview
- Props
- Figma
See the migration guide.
It's used inline within a layout and also act as Alert in the home feed.
Title
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; In hac habitasse.
How to use variants
Use variant based on semantic meaning:
negativefor urgent alertswarningfor alerts of lesser importancepositivefor confirmation/success alertinformativefor information or new announcements
Ouups
Something get wrong, please contact us
Missing information
Some information are missing, some actions can't be done
Success!
Your account has been activated
A new feature is available
Check it out!
Custom icons
You can specify custom icon components. Natively work with <Emoji /> and <Icon />

With an Emoji
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; In hac habitasse.
With an Icon
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; In hac habitasse.
Close button
By passing a handler on onClose prop, the close button will automatically be displayed.
Dissmissable
Hey! Look I'm dissmissable
Using children
In some contexts, you can add content to the <Alert /> as a children.
Oups
We encountered an error! Please report to the team
Children alignment
Sometimes you don't want to get a full-width element and want to align elements at the start, then you can adjust styles directly on your children's element.
Oups
We encountered an error! Please report to the team
⚠️ Do not use text as a children
Prefer to use the description props.
Don't
Don't
A children as a text
Do
Do
A text
Custom description component
Can be useful to add a link in the description for example, you can pass a custom component to the description.
Custom description
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; In hac habitasse. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; In hac habitasse. view more...
Accessibility
This component follows the pattern of WAI-ARIA Alert by adding the role alert.
Then screen reader will automatically read the content when this component appears dynamically.
Playground
murray and murray/mobile.Alert props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| description | ReactNode | |||
| icon | 7 possibilitiesundefinednullReactElement<{ size?: IconSizeundefined; variant?: IconVariantundefined; }, stringJSXElementConstructor<any>> & ReactElement<unknown, stringJSXElementConstructor<any>> | icon to be displayed on the left side of the alert accept Icon or Emoji | ||
| onClose | (() => void)undefined | |||
| sx | PositionPropsundefined | |||
| title | ReactNode | |||
| variant | 5 possibilities"negative""warning""positive""informative"undefined |
Deprecated props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| color | 11 possibilities"negative""warning""positive""informative""white""action""blue""pink""grey""lightgrey"undefined | This property will be removed in the future, use `variant` instead |
Style API
Use sx for one-off adjustments. It accepts these style keys:
Each can be overridden per breakpoint with: