Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
    • Alert
    • ButtonDeprecated
    • Collection
    • DateInputDeprecated
    • Dropdown
    • Frame
    • FullWidthModal
    • LegacyTable
    • SearchInputDeprecated
    • SelectOptionItem
    • Table
    • TextDeprecated
    • TooltipDeprecated
  • Deprecated
  • Alert

Alert

Deprecated

Deprecated component

Do not use it in new code. It stays documented to help migrate its remaining usages.

Use instead:

  • AlertNext from murray: 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.

Health
Component health
Source
View on Github
Design
View Figma
Storybook
View in Storybook
Playground
View in Playground
Accessibility

partially-compliant

Platform
Universal
Accessibility issues
The dismiss control is a focusable element with no button role, no accessible name and no keyboard activation.
  • Overview
  • Props
  • Figma
Loading...
info

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:

  • negative for urgent alerts
  • warning for alerts of lesser importance
  • positive for confirmation/success alert
  • informative for 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​

Loading...
tip
This component is universal, its usage is the same in murray and murray/mobile.

Alert props

NameTypeDefault ValueDescriptionUsage count
descriptionReactNode
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
sxPositionPropsundefined
titleReactNode
variant
5 possibilities"negative""warning""positive""informative"undefined

Deprecated props

NameTypeDefault ValueDescriptionUsage 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:

alignSelfanimationaspectRatiobottomcursordisplayendflexflexBasisflexGrowflexShrinkheightinsetinsetInlineinsetInlineEndinsetInlineStartleftmarginmarginBottommarginHorizontalmarginInlinemarginInlineEndmarginInlineStartmarginLeftmarginRightmarginTopmarginVerticalmatrixmaxHeightmaxWidthminHeightminWidthopacityperspectivepositionrightrotaterotateXrotateYrotateZscalescaleXscaleYskewXskewYstarttoptransformtransformOriginwidthxyzIndex

Each can be overridden per breakpoint with:

$lg$ltLg$ltMd$ltSm$ltVs$ltXl$ltXxl$md$sm$vs$xl$xs$xxl
Edit this page
Previous
UniversalEmoji
Next
ButtonDeprecated
  • How to use variants
  • Custom icons
  • Close button
  • Using children
    • Children alignment
    • ⚠️ Do not use text as a children
  • Custom description component
  • Accessibility
  • Playground